Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Gitbook is used to maintain Ampersand documentation in a collaborative way. This page is the work instruction for all those who help to document Ampersand in Gitbook.
This chapter describes how and why the various items are built.
stack install ormolustack exec ormolu -- --mode inplace $(git ls-files '*.hs')


This page lists the tools that are used and for which purpose they are used. This list is intended for reference, so it is full of hyperlinks that can point you to the right location.
Content-Type: application/json
Authorization: bearer [put your personal access token here]
Accept: application/vnd.github.packages-preview+json{
"query": "query {
viewer { login }
repository(name: \"ampersand\", owner: \"ampersandtarski\") {
id
packages (first: 10) {
nodes {
id
name
versions (first: 100) {
nodes {
id version
}
}
}
}
}
}"
}Content-Type: application/json
Authorization: bearer [put your personal access token here]
Accept: application/vnd.github.package-deletes-preview+json{ "query" : "mutation { deletePackageVersion(input:{packageVersionId:\"[package-version-id]==\"}) { success }}" }|-
|-
|-https://github.com/git-guides/install-git.git clone https://github.com/AmpersandTarski/RAPinstallCloning into 'RAPinstall'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 19 (delta 2), reused 14 (delta 0), pack-reused 0
Unpacking objects: 100% (19/19), done.cd RAPinstalldocker network create proxy3f9552a7506ac5f2b5d9fcb158edae82f9f64e4e3d6b093916d624d118ba342adocker compose up -d ⠿ Network rapinstall_db Created 3.9s
⠿ Network rapinstall_default Created 3.9s
⠿ Volume "rapinstall_rap4-data" Created 0.0s
⠿ Volume "rapinstall_db-data" Created 0.0s
⠿ Volume "rapinstall_letsencrypt" Created 0.0s
⠿ Container traefik Started 7.1s
⠿ Container rap4-db Started 5.2s
⠿ Container rapinstall_dummy-student-prototype_1 Started 5.1s
⠿ Container phpmyadmin Started 12.7s
⠿ Container rap4 Started 12.9s
⠿ Container enroll Starteddocker exec -it rap4 bashchmod 666 /var/run/docker.sockWe use Git for version control, with the shared Ampersand repository located at Github. This chapter provides the information to get to the repository and clone it for having your own local copy.
sjo@lnx-hrl-202v:~$ which docker
/usr/bin/docker
sjo@lnx-hrl-202v:~$ which docker-compose
/usr/bin/docker-composesjo@lnx-hrl-202v:~$ mkdir RAP4
sjo@lnx-hrl-202v:~$ cd RAP4
sjo@lnx-hrl-202v:~/RAP4$ wget https://raw.githubusercontent.com/AmpersandTarski/RAP/master/docker-compose.ymlsjo@lnx-hrl-202v:~/RAP4$ docker compose up -dIf you need an Ampersand compiler in a Docker image, use the one on Docker hub. It sits there ready for you to use. However, if you want to know how it is baked, carry on reading.
docker build -t myampersand ~/Ampersand/docker run -it -v "$(pwd)":/scripts myampersand hello.adldocker run -it -v "%cd%":/scripts myampersand hello.adldocker build -t myampersand ~/Ampersand/FROM haskell:8.6.5 AS buildstageWORKDIR /Ampersand/RUN git clone https://github.com/AmpersandTarski/Ampersand/ .RUN git checkout feature/Archimate3RUN stack installFROM ubuntu:16.04COPY --from=buildstage /root/.local/bin/ampersand /bin/WORKDIR /scripts
VOLUME ["/scripts"]ENTRYPOINT ["/bin/ampersand"]
CMD ["--verbose"]127.0.0.1docker build .Once RAP4 is running, there are maintenance tasks you might want to do. The most frequently used tasks are described here for RAP-3 maintainers to refer to.
stefjoosten$ ssh sjo@rap.cs.ou.nl
sjo@rap.cs.ou.nl's password:
Permission denied, please try again.
sjo@rap.cs.ou.nl's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-124-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
170 packages can be updated.
12 updates are security updates.
New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Wed May 29 12:03:17 2019 from 145.20.142.195
sjo@lnx-hrl-202v:~$cd RAP4
sjo@lnx-hrl-202v:~/RAP4$sjo@lnx-hrl-202v:~/RAP4$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
40e5e97c1b26 phpmyadmin/phpmyadmin "/run.sh superviso..." 4 months ago Up 36 seconds 9000/tcp, 0.0.0.0:8080->80/tcp rap3_phptools_1
bff782b2da89 ampersandtarski/rap4-db "docker-entrypoint..." 4 months ago Up 2 weeks 3306/tcp rap3_db_1
773f7ad86527 dockerampersand_rap3 "docker-php-entryp..." 18 months ago Up 2 weeks 0.0.0.0:80->80/tcp dockerampersand_rap3_1
7525eb7ea95f dockerampersand_db "docker-entrypoint..." 18 months ago Up 2 weeks 3306/tcp dockerampersand_db_1
sjo@lnx-hrl-202v:~/RAP4$ sjo@lnx-hrl-202v:~/RAP4$ ls -al
total 20
drwxrwxr-x 3 sjo sjo 4096 Oct 25 2018 .
drwxr-xr-x 18 sjo sjo 4096 Jan 9 2018 ..
-rw-rw-r-- 1 sjo sjo 472 Oct 25 2018 docker-compose.yml
drwxr-xr-x 5 root root 4096 Dec 15 2017 volumes
sjo@lnx-hrl-202v:~/RAP4$ sjo@lnx-hrl-202v:~/RAP4$ cat docker-compose.yml
version: '3'
services:
rap4:
restart: always
image: ampersandtarski/ampersand-rap:latest
ports:
- "80:80"
links:
- db
volumes:
- ./volumes/log:/var/www/html/RAP4/log
- ./volumes/scripts:/var/www/html/RAP4/scripts
db:
restart: always
image: ampersandtarski/rap4-db
volumes:
- ./volumes/mysql:/var/lib/mysql
phptools:
image: phpmyadmin/phpmyadmin
ports:
- "8080:80"
links:
- db
sjo@lnx-hrl-202v:~/RAP4$sjo@lnx-hrl-202v:~/RAP4$ ls -al volumes/
total 40
drwxr-xr-x 5 root root 4096 Dec 15 2017 .
drwxrwxr-x 3 sjo sjo 4096 Oct 25 2018 ..
drwxr-xr-x 2 www-data www-data 4096 Dec 28 11:16 log
drwxr-xr-x 229 999 999 20480 May 13 07:48 mysql
drwxr-xr-x 75 www-data www-data 4096 Oct 25 2018 scripts
sjo@lnx-hrl-202v:~/RAP4$sjo@lnx-hrl-202v:~/RAP4$ docker-compose up -d% ssh sjo@rap.cs.ou.nl
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-151-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Wed Aug 11 10:26:22 CEST 2021
System load: 0.08
Usage of /: 68.3% of 48.83GB
Memory usage: 17%
Swap usage: 0%
Processes: 264
Users logged in: 0
IP address for ens160: 145.20.188.96
IP address for br-0b19c7bfdba3: 172.20.0.1
IP address for br-0f95c427718c: 172.26.0.1
IP address for docker0: 172.17.0.1
* Canonical Livepatch is enabled.
- All available patches applied.
84 packages can be updated.
1 update is a security update.
*** System restart required ***
Last login: Mon Aug 2 11:14:56 2021 from 145.20.142.176
sjo@lnx-hrl-202v:~$sjo@lnx-hrl-202v:~$ sudo apt update
sjo@lnx-hrl-202v:~$ sudo apt upgradewget https://raw.githubusercontent.com/AmpersandTarski/RAP/master/docker-compose.yml> ampersand --version
Ampersand-v3.17.4 [master:fd90ea3f1], build time: 15-Nov-19 18:02:19 CET> docker run -it ampersandtarski/ampersand127.0.0.1 example.comC:\> ipconfig /flushdns sudo docker pssjo@Wolfram:~$ mkdir docker-RAP4
sjo@Wolfram:~$ cd docker-RAP4
sjo@Wolfram:~/docker-RAP4$ wget https://github.com/AmpersandTarski/RAP/raw/master/docker-compose.ymlsjo@Wolfram:~$ sudo docker-compose up -d



This page is under construction and does not work yet. Help is appreciated. Currently, the move from docker-compose to Kubernetes has low priority.
sysctl -a | grep machdep.cpu.features | grep VMXbrew update && brew install kubectl && brew cask install docker minikube virtualboxdocker --version # Docker version 17.09.0-ce, build afdb6d4
docker-compose --version # docker-compose version 1.16.1, build 6d1ac21
docker-machine --version # docker-machine version 0.12.2, build 9371605
minikube version # minikube version: v0.22.3
kubectl version --client # Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-12T00:45:05Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"darwin/amd64"} minikube startStarting local Kubernetes cluster...
Kubectl is now configured to use the cluster.kubectl get nodesNAME STATUS ROLES AGE VERSION
minikube Ready <none> 40s v1.7.5eval $(minikube docker-env)eval $(docker-machine env -u)CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3835176d93bb k8s.gcr.io/k8s-dns-sidecar-amd64 "/sidecar --v=2 --lo…" 30 minutes ago Up 30 minutes k8s_sidecar_kube-dns-86f4d74b45-4b48w_kube-system_91346644-e424-11e8-bae2-080027501972_0
3c803544be8a k8s.gcr.io/kubernetes-dashboard-amd64 "/dashboard --insecu…" 30 minutes ago Up 30 minutes k8s_kubernetes-dashboard_kubernetes-dashboard-6f4cfc5d87-mvtgw_kube-system_962829f4-e424-11e8-bae2-080027501972_0
1d74c735c1df k8s.gcr.io/coredns "/coredns -conf /etc…" 30 minutes ago Up 30 minutes k8s_coredns_coredns-c4cffd6dc-xn62h_kube-system_961c845a-e424-11e8-bae2-080027501972_0
308bd132b35a gcr.io/k8s-minikube/storage-provisioner "/storage-provisioner" 31 minutes ago Up 30 minutes k8s_storage-provisioner_storage-provisioner_kube-system_963bf651-e424-11e8-bae2-080027501972_0docker run -d -p 5000:5000 --restart=always --name registry registry:2BA92-C02VP224HTDF:RAP stefjoosten$ docker ps | grep registry
97dc5ed7102d registry:2 "/entrypoint.sh /etc…" 4 days ago Up 4 days 0.0.0.0:5000->5000/tcp registry
BA92-C02VP224HTDF:RAP stefjoosten$
docker build . --tag my-appdocker tag my-app localhost:5000/my-app:0.1.0REPOSITORY TAG IMAGE ID CREATED SIZE
my-app latest cc949ad8c8d3 44 seconds ago 89.3MB
localhost:5000/my-app 0.1.0 cc949ad8c8d3 44 seconds ago 89.3MB
httpd 2.4-alpine fe26194c0b94 7 days ago 89.3MBbrew install komposekompose upkompose convertdb-claim0-persistentvolumeclaim.yaml
db-deployment.yaml
phptools-deployment.yaml
phptools-service.yaml
rap3-claim0-persistentvolumeclaim.yaml
rap3-claim1-persistentvolumeclaim.yaml
rap3-deployment.yaml
rap3-service.yamlBA92-C02VP224HTDF:RAP stefjoosten$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/db-56c6b7b6cc-442k9 1/1 Running 1 3d
pod/phptools-555cc5db49-w7z6k 1/1 Running 0 3d
pod/rap3-668d94bb95-cp8vs 1/1 Running 0 3d
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 4d
service/phptools ClusterIP 10.107.212.219 <none> 8080/TCP 3d
service/rap3 ClusterIP 10.101.81.211 <none> 80/TCP 3d
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/db 1 1 1 1 3d
deployment.apps/phptools 1 1 1 1 3d
deployment.apps/rap3 1 1 1 1 3d
NAME DESIRED CURRENT READY AGE
replicaset.apps/db-56c6b7b6cc 1 1 1 3d
replicaset.apps/phptools-555cc5db49 1 1 1 3d
replicaset.apps/rap3-668d94bb95 1 1 1 3dBA92-C02VP224HTDF:RAP stefjoosten$ minikube service rap3
Opening kubernetes service default/rap3 in default browser...
BA92-C02VP224HTDF:RAP stefjoosten$ minikube service phptools
Opening kubernetes service default/phptools in default browser...kubectl create -f my-app.ymlkubectl get allminikube service my-app --urlminikube dashboardkubectl delete deploy my-app
kubectl delete service my-appminikube stop;
minikube delete;
rm -rf ~/.minikube .kube;
brew uninstall kubectl;
brew cask uninstall docker virtualbox minikube;sjo@lnx-hrl-202v:~$ which docker
/usr/bin/docker
sjo@lnx-hrl-202v:~$ which docker-compose
/usr/bin/docker-composesudo -i
git clone https://github.com/AmpersandTarski/docker-ampersand/ /home/$(whoami)/docker-ampersand
cd docker-ampersand/
./build.shWolfram docker-ampersand # docker build -t ampersand:latest ampersand
Sending build context to Docker daemon 4.096 kB
Step 1 : FROM php:7-apache
---> 2720c02fc079
Step 2 : ENV PATH /texlive/bin/x86_64-linux:$PATH
---> Using cache
---> 45d62477f5e2
Step 3 : RUN apt-get update && apt-get install -y --no-install-recommends git graphviz wget xorriso && curl -sSL https://get.haskellstack.org/ | /bin/sh && rm -rf /var/lib/apt/lists/*
---> Using cache
---> e37542ec9301
Step 4 : ENV TL_VERSION 2016-20160523
---> Using cache
---> f95346ded414
Step 5 : ADD texlive.profile /tmp
---> Using cache
---> add9fd911c38
Step 6 : RUN cd ~ && wget -q http://mirrors.ctan.org/systems/texlive/Images/texlive$TL_VERSION.iso && wget -qO- http://mirrors.ctan.org/systems/texlive/Images/texlive$TL_VERSION.iso.sha512 | sha512sum -c && osirrox -report_about NOTE -indev texlive$TL_VERSION.iso -extract / /usr/src/texlive && rm texlive$TL_VERSION.iso && /usr/src/texlive/install-tl -profile /tmp/texlive.profile && rm -rf /usr/src/texlive && rm /tmp/texlive.profile
---> Using cache
---> f0ebcd4cf50c
Step 7 : RUN mkdir ~/git && cd ~/git && git clone --branch development https://github.com/AmpersandTarski/Ampersand
---> Using cache
---> 08643d5cce73
Step 8 : RUN cd ~/git/Ampersand && stack setup && stack install --local-bin-path /usr/local/bin
---> Using cache
---> 636036e98214
Step 9 : RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php --install-dir=/usr/local/bin --filename=composer && php -r "unlink('composer-setup.php');"
---> Using cache
---> e8648c6657f6
Successfully built e8648c6657f6sjo@lnx-hrl-202v:~/ampersand-models/RAP4$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ampersandtarski/ampersand-rap latest 636643166a78 2 hours ago 3.62GB
ampersandtarski/ampersand-prototype-db latest d267da36fb90 4 hours ago 395MB
ampersandtarski/ampersand-prototype texlive efd0dccd6b4b 6 hours ago 3.11GB
phpmyadmin/phpmyadmin latest 200931982ab6 6 days ago 110MBdocker push ampersandtarski/ampersand-rap
docker push ampersandtarski/ampersand-prototype-db
docker push ampersandtarski/ampersand-prototypecd /home/ampersandadmin/docker-ampersand
docker-compose up -ddocker exec -ti dockerampersand_rap4_1 /bin/bash














