git.iko.soy/typeable/octopod
on v0.10.0 help sign in
typeable/octopod/README.md
168 lines 3.9 kB history raw
1# DM
3Multi-staging Deployment Manager (DM). MD consists of the client and server parts (DMC and DMS accordingly).
5# Installation
71. Install Nix
9```bash
10curl https://nixos.org/nix/install | sh
11```
132. Build the project
15```bash
16make build
17```
19# Interact with DMC
21```bash
22$ result/bin/dmc-exe --help
23DMC
25Usage: dmc-exe (create | list | edit | delete | update | info | cleanup |
26 restore | cleanarchive)
28Available options:
29 -h,--help Show this help text
31Available commands:
32 create
33 list
34 edit
35 delete
36 update
37 info
38 cleanup
39 restore
40 cleanarchive
41```
43# Interact with DMS
45```bash
46$ result/bin/dms-exe --help
47DMS
49Usage: dms-exe --port INT --ui-port INT --db TEXT --db-pool-size INT
50 --tls-cert-path TEXT --tls-key-path TEXT --tls-store-path TEXT
52Available options:
53 -h,--help Show this help text
54```
56# Build and publish docker images to ECR
58For a build and publish of Docker images you must have needed AWS permissions: access to SSM and ECR!
60```
61./release.sh <user|ci>
62```
64# Kubernetes installation
661. Deploy DMS's infra
68```bash
69./b2b-helm-tool -d deploy dms-infra
70```
722. Clone b2b-helm to `/tmp`
74```bash
75git clone https://github.com/Aviora/b2b-helm.git /tmp/b2b-helm
76```
783. Give needed permissions for DMS
80```bash
81cd /tmp/b2b-helm/charts/admin && helm install --name dm-helm-access ./helm-access
82cd /tmp/b2b-helm/charts/admin && helm install --name dm-pvc-control ./pvc-control
83cd /tmp/b2b-helm/charts/admin && helm install --name dm-cert-control ./cert-control
84```
864. Deploy DMS
88```bash
89./b2b-helm-tool -d deploy dms:latest
90```
92# How to deploy a new staging
94```bash
95dmc create --name STAGING_NAME -t DOCKER_IMAGE_TAG -e ENV_VAR1=env_val1 -e ENV_VAR2=env_val2
96```
98Or use Docker:
99```bash
100docker run -ti --rm 560065381221.dkr.ecr.us-east-1.amazonaws.com/dmc:latest create --name STAGING_NAME -t DOCKER_IMAGE_TAG -e ENV_VAR1=env_val1 -e ENV_VAR2=env_val2
101```
103Note that in our ECR(hosted docker registry) we use a convention of
104DOCKER_IMAGE_TAG = GIT_SHA. So, if this build was successfully built on github
105actions CI and docker image was pushed to ECR, you can deploy it without any
106intermediate steps.
108# How to override an environment variable in an application
110```bash
111dmc edit --name STAGING_NAME
112```
114Or use Docker:
115```bash
116# use Vim
117docker run -ti --rm 560065381221.dkr.ecr.us-east-1.amazonaws.com/dmc:latest edit --name STAGING_NAME
119# use Emacs
120docker run -ti -e EDITOR=emacs --rm 560065381221.dkr.ecr.us-east-1.amazonaws.com/dmc:latest edit --name STAGING_NAME
121```
123`dmc edit` opens an `$EDITOR` where you can override staging variables. To
124override an environment variable `FOO` with a value `foo`, add a line like this:
126```
127FOO=foo
128```
130To commit the changes, save the file and quit your default `$EDITOR`. `:wq` in
131vim. Note that to discard your changes, you have to exit your `$EDITOR` with a
132not-zero exit code. You can do this by typing `:cq` in vim.
134# How clean up Docker cache
136DMC using a certificate for authentication in DMS.
137After deploy of new DMS's version needs to use a new certificate.
139To make sure the actual image is being used, remove the old docker image and pull the new one before with:
141```bash
142docker rmi 560065381221.dkr.ecr.us-east-1.amazonaws.com/dmc:latest
143docker pull 560065381221.dkr.ecr.us-east-1.amazonaws.com/dmc:latest
144```
146# Develop
148Cache set up:
149```
150binary-caches = https://cache.nixos.org https://nixcache.reflex-frp.org
151binary-cache-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=
152binary-caches-parallel-connections = 40
153```
155Enter shell to work on the backend:
156```
157make shell
158```
160Enter shell to work on the frontend (with GHC):
161```
162make shell
163```
165Enter shell to work on the frontend (with GHCJS):
166```
167make shell-ghcjs
168```