-
Notifications
You must be signed in to change notification settings - Fork 82
Conversation
* This is an initial commit with a working minimal implementation * Addresses getodk#272 partially * Dockerfile for Build * docker-compose for Build and Postgres (but not yet build2xlsform) * ancillary scripts * updated docs (offline notice, deployment)
BUILDING.md
Outdated
@@ -29,11 +29,68 @@ This section contains package maintenance procedures in preparation for deployme | |||
git push --tags | |||
``` | |||
* Create a new release from the new tag on GitHub and let GitHub auto-generate release notes. Mark releases used for testing as pre-release. The release bundles the code into an archive, which we'll use for deployment. | |||
* Pushing a new tag will generate a new Docker image with the same tag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...once the GH action is in place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* that starts with v
.. or is it all tags?
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@@ -0,0 +1,177 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Borrowed 1:1 from ODK Central
volumes: | ||
- /var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: odkbuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credentials hard coded here and in config.yml - could be parameterised via ENV. Seems good enough for Central though.
@@ -195,6 +195,7 @@ | |||
</div> | |||
<div class="offlineNotice"> | |||
Tired of logging in? Did you know there is a <a href="https://github.com/getodk/build/releases/latest" rel="external">downloadable version of ODK Build available?</a> Simply save your forms to file from here using the File menu and you can open them there. | |||
Follow the instructions <a href="https://github.com/getodk/build/blob/master/BUILDING.md">here</a> to run Build on your machine with `docker-compose`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure there is better wording for this
stdout_path "/var/log/odkbuild/stdout.log" | ||
|
||
listen "/var/odkbuild/build-server.sock", :backlog => 64 | ||
listen 9393, :tcp_nopush => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from this line, exactly taken from a working server
For the GH action, I'll need a repo secret "GH_PAT" with a GH Personal Access Token for my GH actor. The image gets pushed to We will need a core team member to create the secrets
I will flail around on this downstream branch trying to get the action to work with my own credentials. Once working, the action should work upstream too. Edit: oh look at that. https://github.com/orgs/dbca-wa/packages/container/package/odkbuild |
* likely to fail on missing credentials * need core team to create secrets GH_PAT and GH_ACTOR
* env var to toggle build2xlsform/localhost as hostname for conversion service * two docker-compose files for dev (build master) and deploy (pull tagged image) * docs in building and compose files to describe how and when to use
i didn't look up every flag but it all looks fine. the biggest red flag is we should name the postgres volume so we don't end up in a nightmare situation like we have with central again. the rest are comments in there. probably somebody with more recent experience actually running build in production should also take a quick peek. |
Thanks for the valuable feedback! I will name the postgres data volume. |
* naming suggestion: volume named `odkbuild` identical to GHA image name assuming that `build` is overloaded (hence prefixed) but there will not be other volumes (hence not postfixed with e.g. _pgdata * volume survives `docker-compose down` and is picked up again by next `docker-compose up`
* naming suggestion: volume named `odkbuild` identical to GHA image name assuming that `build` is overloaded (hence prefixed) but there will not be other volumes (hence not postfixed with e.g. _pgdata * volume survives `docker-compose down` and is picked up again by next `docker-compose up`
* GHA: only build when a tag beginning with "v" is pushed, drop development builds on every push to master/main/this PR branch * docker-compose: use what I think could be the official GetODK image names, but final naming is up to the core team * docker image versions: currently referring to "latest" for ease of testing, should be pinned before used in prod
Addressing review commentsI've pushed the last bunch of commits now to prepare for merging (see commit messages):
TestingThe docker-compose file will not build as is, because the referenced official images are not published yet. See 19a52aa for working published images through my own downstream repos. Next steps
|
* Proposed at getodk/build2xlsform#23 * Prefix negotiable * The image will only exist when getodk/build2xlsform#23 is merged
Dockerfile
Outdated
@@ -0,0 +1,39 @@ | |||
FROM ruby:2.7.2 | |||
LABEL author="GetODK Inc." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yanokwa? We usually say ODK or ODK Community, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to ODK for now.
name: docker | ||
|
||
env: | ||
IMAGE_NAME: odkbuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the best image name?
Since it is lower cased, I added a prefix odk
to clarify that this image refers to the software ODK Build.
I've used getodk/odkbuild2xlsform on the other end.
BUILDING.md
Outdated
@@ -29,11 +29,68 @@ This section contains package maintenance procedures in preparation for deployme | |||
git push --tags | |||
``` | |||
* Create a new release from the new tag on GitHub and let GitHub auto-generate release notes. Mark releases used for testing as pre-release. The release bundles the code into an archive, which we'll use for deployment. | |||
* Pushing a new tag will generate a new Docker image with the same tag. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@@ -195,6 +195,7 @@ | |||
</div> | |||
<div class="offlineNotice"> | |||
Tired of logging in? Did you know there is a <a href="https://github.com/getodk/build/releases/latest" rel="external">downloadable version of ODK Build available?</a> Simply save your forms to file from here using the File menu and you can open them there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line will be obsolete once the docker-compose
option is available.
Dockerfile
Outdated
@@ -0,0 +1,39 @@ | |||
FROM ruby:2.7.2 | |||
LABEL author="GetODK Inc." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to ODK for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outstanding discussion points:
If we want to go down the docker-compose road, this could close a whole raft of issues and discussion points:
As I find time I will add the remaining bits. Any feedback or governance welcome.
Impressions:
![image](https://user-images.githubusercontent.com/762815/151547020-5c43924c-e8bc-40d0-bc2e-de207cd7cc5c.png)
Running in portainer
Listed on the shell
![image](https://user-images.githubusercontent.com/762815/151547050-2ed6b6c6-4c16-4039-a681-d074685daef6.png)
Running in browser
![image](https://user-images.githubusercontent.com/762815/151547088-32485750-c2ea-43a6-94c9-5dd685840015.png)