From 4e0a63b507bb203b07c6690fbcd1c0cdd5cc9527 Mon Sep 17 00:00:00 2001 From: Xiao Gui Date: Tue, 27 Jun 2023 13:23:17 +0200 Subject: [PATCH] maint: bump siibra version maint: cache docker build layers maint: split requirements --- .github/workflows/docker-img.yml | 4 +++- .openshift/README.md | 1 - api/siibra_api_config.py | 2 +- requirements/all.txt | 9 +-------- requirements/partial-all.txt | 8 ++++++++ requirements/partial-worker.txt | 2 ++ requirements/siibra.txt | 2 +- requirements/worker.txt | 3 +-- 8 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 requirements/partial-all.txt create mode 100644 requirements/partial-worker.txt diff --git a/.github/workflows/docker-img.yml b/.github/workflows/docker-img.yml index 6811332..aef033a 100644 --- a/.github/workflows/docker-img.yml +++ b/.github/workflows/docker-img.yml @@ -16,7 +16,6 @@ env: OKD_DEV_SECRET: ${{ secrets.OKD_DEV_SECRET }} DOCKER_REGISTRY: 'docker-registry.ebrains.eu/siibra/' DOCKER_IMG: 'siibra-api' - DOCKER_IMAGE_TAG: 'latest' jobs: build-docker-img: @@ -41,6 +40,9 @@ jobs: - name: "Build docker image" run: | GIT_HASH=$(git rev-parse --short HEAD) + cached_image=${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMG }}:latest${{ matrix.tag_suffix }} + echo "Pulling $cached_image to populate cached layers." + docker pull $cached_image docker build --build-arg GIT_HASH=$GIT_HASH -t siibra-api-tmp-img -f ${{ matrix.dockerfile }} . - name: "Tag and Push (latest || rc)" diff --git a/.openshift/README.md b/.openshift/README.md index 64a724e..d2371b1 100644 --- a/.openshift/README.md +++ b/.openshift/README.md @@ -151,6 +151,5 @@ Per [deployment template](./branch-deploy-template.yml), a number of parameters | name | required | desc | | --- | --- | --- | | `SESSION_SECRET` | | Random strings to encrypt sessions. Not currently used. | -| `DOCKER_IMAGE_TAG` | true | Dictates which image tag to pull. Currently, possible values are `{latest\|rc\|stable}`. | | `DEPLOY_FLAVOUR` | true | Acts similar to deploy ID. Distinguishes one deployment from another. Currently, possible values are `{latest\|rc\|stable}`. Also affects routes: `siibra-api-{DEPLOY_FLAVOUR}.apps{DEPLOY_SITE_POSTFIX}.hbp.eu` | | `DEPLOY_SITE_POSTFIX` | | Dictates if postfix, if any, should be added to the route: `siibra-api-{DEPLOY_FLAVOUR}.apps{DEPLOY_SITE_POSTFIX}.hbp.eu`. Defaults to `''` (empty string). Possible value: `-dev`| diff --git a/api/siibra_api_config.py b/api/siibra_api_config.py index 8855bc2..aa64b78 100644 --- a/api/siibra_api_config.py +++ b/api/siibra_api_config.py @@ -1,6 +1,6 @@ import os -__version__ = "0.3.8" +__version__ = "0.3.9" NAME_SPACE = os.environ.get("SIIBRA_API_NAMESPACE", "siibraapi") diff --git a/requirements/all.txt b/requirements/all.txt index 6f266a9..516c556 100644 --- a/requirements/all.txt +++ b/requirements/all.txt @@ -1,9 +1,2 @@ -requests -fastapi -fastapi-versioning -fastapi-pagination -jinja2 -uvicorn[standard] -redis -diskcache +-r partial-all.txt -r siibra.txt diff --git a/requirements/partial-all.txt b/requirements/partial-all.txt new file mode 100644 index 0000000..6b08d70 --- /dev/null +++ b/requirements/partial-all.txt @@ -0,0 +1,8 @@ +requests +fastapi +fastapi-versioning +fastapi-pagination +jinja2 +uvicorn[standard] +redis +diskcache diff --git a/requirements/partial-worker.txt b/requirements/partial-worker.txt new file mode 100644 index 0000000..d0e0beb --- /dev/null +++ b/requirements/partial-worker.txt @@ -0,0 +1,2 @@ +celery[redis]==5.2.6 +pydantic diff --git a/requirements/siibra.txt b/requirements/siibra.txt index 0b5a1b5..9932571 100644 --- a/requirements/siibra.txt +++ b/requirements/siibra.txt @@ -1,2 +1,2 @@ -siibra>=0.4a57 +siibra>=0.4a58 diff --git a/requirements/worker.txt b/requirements/worker.txt index 556e995..cd03283 100644 --- a/requirements/worker.txt +++ b/requirements/worker.txt @@ -1,3 +1,2 @@ -r siibra.txt -celery[redis]==5.2.6 -pydantic +-r partial-worker.txt