Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic cantaloupe sidecar. #8

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ jobs:
NOMAD_VAR_CHECK_PROTOCOL: 'http'
NOMAD_ADDR: 'https://ux-fnf-misc.archive.org/'
NOMAD_VAR_COUNT_CANARIES: 0
# NOMAD_VAR_CHECK_TIMEOUT: '10m'
NOMAD_VAR_PORTS: '{ 8080 = "http", 8182 = "cantaloupe" }'
NOMAD_VAR_COUNT: 1
NOMAD_VAR_MULTI_CONTAINER: 'true'
NOMAD_VAR_HEALTH_TIMEOUT: '30m'
NOMAD_VAR_HOSTNAMES: '["iiif.ux-fnf-misc.archive.org"]'
NOMAD_VAR_PORTS: '{8080 = "http"}'
NOMAD_VAR_FORCE_PULL: 'true'
deploy:
environment:
name: development
url: https://archivelabs-iiif-archivelab-org-${{ env.BRANCH_NAME }}.ux-fnf-misc.archive.org
url: https://iiif-${{ env.BRANCH_NAME }}.ux-fnf-misc.archive.org
runs-on: ubuntu-latest
needs: cicd
steps:
- name: Checkout # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v2
- name: Export BRANCH_NAME # store branch name in $BRANCH_NAME
run: echo BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` >> $GITHUB_ENV
run: echo BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` >> $GITHUB_ENV
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variables:
NOMAD_VAR_PORTS: '{ 8080 = "http", 8182 = "cantaloupe" }'
NOMAD_VAR_CHECK_PATH: '/static/images/ia.png'
NOMAD_VAR_MULTI_CONTAINER: 'true'
NOMAD_VAR_COUNT_CANARIES: 0
NOMAD_VAR_COUNT: 1
NOMAD_VAR_HEALTH_TIMEOUT: '30m'

include:
- remote: 'https://gitlab.com/internetarchive/nomad/-/raw/master/.gitlab-ci.yml'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY . /app

COPY ./nginx-vhost.conf /etc/nginx/conf.d/nginx.conf
CMD /app/start.sh
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ This service replaces the iiif.archivelab.org unofficial labs API.

The service uses a manifest/API service written in python3 flask and makes image processing calls to cantaloupe in both iiif 3.0 and 2.0 format.

Note that this repository contains a `Dockerfile` used to build the previously mentioned `python3 flask` application. The [nomad](https://gitlab.com/internetarchive/nomad) repository is used for automated testing and deployment; In particular `.github/workflows/cicd.yml` and `.gitlab-ci.yml` relate to that system.

Note also that `start.sh` is run on container startup, and that it makes assumptions about what environment variables exist at this point; In particular `NOMAD_HOST_ADDR_cantaloupe` is assumed to exist, which is created dynamically based on the `nomad` repository handling `group.nomad` and the configuration in the relevant yaml file.


## Installation & Setup
```
git clone https://github.com/internetarchive/iiif.git
Expand Down
Loading