-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add build to github registry * Add ci to build and upload container images * Update registry_upload.yml * Remove unused section * Update metadata context * Removed more unsed steps * Update context * Update context * Update context * Update context * Disable push of ingest docker image, as it is not available yet. * Change versions of github docker actions. * Build and publish ARM image. * Add amd64 build. * Change platform to arm64 and amd64. * Update registry_upload.yml * Update registry_upload.yml * Fix trailing whitespcae * Update registry_upload.yml * Fix trailing whitespcae * Exclude workflow files from yaml lint, since github support none standard formats in yaml * Update readme with more env variables * Enable building of ingest image. * Fix label on main branch for docker images (YAML scalar cannot contain comments). * Update registry_upload.yml --------- Co-authored-by: Jeffrey Vervoort <[email protected]>
- Loading branch information
1 parent
1a3ff81
commit e8de15c
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Create and publish a Docker image | ||
|
||
# Configures this workflow to run on main when testing CI is completed. | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
CPU: "arm64" | ||
|
||
jobs: | ||
|
||
on-failure: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- run: echo 'The triggering CI workflow failed' | ||
docker-build-and-publish: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | ||
permissions: | ||
contents: read | ||
packages: write | ||
strategy: | ||
matrix: | ||
include: | ||
- context: ./datastore/datastore/ | ||
IMAGE_NAME: datastore | ||
- context: ./api/ | ||
IMAGE_NAME: api | ||
- context: ./ingest/ | ||
IMAGE_NAME: ingest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: ${{ env.CPU }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.IMAGE_NAME }} | ||
# Set tag to latest if there is no release tag from git | ||
# Tag the build with the current release | ||
tags: | | ||
type=raw,value=latest,enable={{is_default_branch && !tag}} | ||
type=tag,event=tag,enable={{is_default_branch}} | ||
- name: Copy Protobuf files to Dockerfile directories | ||
run: ./ci/docker/copy-protobuf.sh | ||
|
||
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. | ||
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. | ||
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ matrix.context }} | ||
platforms: linux/arm64, linux/amd64 | ||
file: ${{ matrix.context }}/Dockerfile | ||
pull: true | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
# E-SOH API | ||
|
||
## Enviorment variable | ||
These enviorment variables should be set when you are starting the container or be set in the enviorment where you are running the application. | ||
### DSHOST | ||
|
||
IP address to datastore | ||
|
||
### DSPORT | ||
|
||
Port the datastore is available on. | ||
|
||
### FORWARDED_ALLOW_IPS | ||
|
||
Environment variable used to set the `forwarded-allow-ips` in gunicorn. If this API is set behind a proxy, `FORWARDED_ALLOW_IPS` should be set to the proxy IP. Setting this to `*` is possible, but should only be set if you have ensured the API is only reachable from the proxy, and not directly from the internet. If not using docker compose this have to be passed to docker using the `-e` argument. |
e8de15c
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.
API Unit Test Coverage Report
API Unit Test Coverage Summary