From 03a0745e0d321627229d4885e9fea93aa6e67517 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 25 Mar 2022 10:57:22 -0500 Subject: [PATCH 01/15] codebook env image | ci/cd --- .../anchored_docker_images.yaml | 86 +++++++++++++++++++ .github/.staging_workflows/normalize.sh | 14 +++ .github/.test/.secrets | 4 + .github/.test/README.md | 3 + .github/make-prod.sh | 2 + .github/make-test.sh | 2 + .github/run-local.sh | 7 ++ .github/workflows/docker_images.yaml | 61 +++++++++++++ .gitignore | 1 + docker/codebook.Dockerfile | 27 ++++++ docker/docker-compose-codebook_env.yaml | 15 ++++ 11 files changed, 222 insertions(+) create mode 100644 .github/.staging_workflows/anchored_docker_images.yaml create mode 100644 .github/.staging_workflows/normalize.sh create mode 100644 .github/.test/.secrets create mode 100644 .github/.test/README.md create mode 100644 .github/make-prod.sh create mode 100644 .github/make-test.sh create mode 100644 .github/run-local.sh create mode 100644 .github/workflows/docker_images.yaml create mode 100644 docker/codebook.Dockerfile create mode 100644 docker/docker-compose-codebook_env.yaml diff --git a/.github/.staging_workflows/anchored_docker_images.yaml b/.github/.staging_workflows/anchored_docker_images.yaml new file mode 100644 index 00000000..95d931aa --- /dev/null +++ b/.github/.staging_workflows/anchored_docker_images.yaml @@ -0,0 +1,86 @@ +# + +name: docker_images +on: + push: + pull_request: + +### For act testing locally +anchor-dev-if: &dev-if + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'yambottle' +anchor-dev-workflow: &dev-workflow + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main +### For Github Action run in your own fork with release +anchor-test-if: &test-if + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'yambottle' +anchor-test-workflow: &test-workflow + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main +### For Github Action run in datajoint +anchor-prod-if: &prod-if + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'datajoint' +anchor-prod-workflow: &prod-workflow + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main +### Common anchor +anchor-workflow-secrets: &workflow-secrets + secrets: + RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} + REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} + +jobs: + get_meta: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: get_version + name: Get build metadata + run: | + ## Get workflow version as codebook env image version + echo "::set-output name=workflow_version::$(cat workflow/version.py | tail -1 | awk -F\' '{print $2}')" + - id: create_release + name: Create release + !!merge <<: *$STAGE-if + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + tag_name: ${{steps.get_version.outputs.workflow_version}} + release_name: Release ${{steps.get_version.outputs.workflow_version}} + body: Release ${{steps.get_version.outputs.workflow_version}} + draft: false + prerelease: false + outputs: + workflow_version: ${{steps.get_version.outputs.workflow_version}} + release_upload_url: ${{steps.create_release.outputs.upload_url}} + + call_u24_docker_image_py39: + needs: [get_meta] + !!merge <<: *$STAGE-workflow + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + workflow_version: ${{needs.get_meta.outputs.workflow_version}} + release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} + !!merge <<: *workflow-secrets + call_u24_docker_image_py38: + needs: [get_meta] + !!merge <<: *$STAGE-workflow + with: + jhub_ver: 1.4.2 + py_ver: 3.8 + dist: debian + workflow_version: ${{needs.get_meta.outputs.workflow_version}} + release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} + !!merge <<: *workflow-secrets + +# \ No newline at end of file diff --git a/.github/.staging_workflows/normalize.sh b/.github/.staging_workflows/normalize.sh new file mode 100644 index 00000000..08619ee2 --- /dev/null +++ b/.github/.staging_workflows/normalize.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# For Github Action that doesn't support anchor yet... +# https://github.com/actions/runner/issues/1182 + +STAGE=$1 +# .yaml in .staging_workflows has to be named using a prefix 'anchored_', this will be removed when normalizing +PREFIX="anchored_" +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +for source in $(ls $SCRIPT_DIR | grep yaml) +do + target=${source#$PREFIX} + export STAGE + envsubst '${STAGE}' < $SCRIPT_DIR/$source | yq e 'explode(.) | del(.anchor-*)' > $SCRIPT_DIR/../workflows/$target +done \ No newline at end of file diff --git a/.github/.test/.secrets b/.github/.test/.secrets new file mode 100644 index 00000000..0cdd0de7 --- /dev/null +++ b/.github/.test/.secrets @@ -0,0 +1,4 @@ +RAW_DEPLOY_KEY= +GITHUB_TOKEN= +REGISTRY_USERNAME= +REGISTRY_PASSWORD= \ No newline at end of file diff --git a/.github/.test/README.md b/.github/.test/README.md new file mode 100644 index 00000000..3ffc63a0 --- /dev/null +++ b/.github/.test/README.md @@ -0,0 +1,3 @@ +For local testing using act, you need to create few things: +- make a `.test/artifacts` dir for `act --artifact-server-path ./.test/artifacts/` +- make a `.test/.secrets` file similar as `.env` for `act --secret-file ./.test/.secrets` \ No newline at end of file diff --git a/.github/make-prod.sh b/.github/make-prod.sh new file mode 100644 index 00000000..806e39ef --- /dev/null +++ b/.github/make-prod.sh @@ -0,0 +1,2 @@ +#!/bin/bash +bash ./.staging_workflows/normalize.sh prod \ No newline at end of file diff --git a/.github/make-test.sh b/.github/make-test.sh new file mode 100644 index 00000000..3870e77d --- /dev/null +++ b/.github/make-test.sh @@ -0,0 +1,2 @@ +#!/bin/bash +bash ./.staging_workflows/normalize.sh test \ No newline at end of file diff --git a/.github/run-local.sh b/.github/run-local.sh new file mode 100644 index 00000000..4ae9cdfb --- /dev/null +++ b/.github/run-local.sh @@ -0,0 +1,7 @@ +#!/bin/bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +bash $SCRIPT_DIR/.staging_workflows/normalize.sh dev +cd .. +act -P ubuntu-latest=drewyangdev/ubuntu:act-latest \ + --secret-file $SCRIPT_DIR/.test/.secrets \ + --artifact-server-path $SCRIPT_DIR/.test/artifacts/ \ No newline at end of file diff --git a/.github/workflows/docker_images.yaml b/.github/workflows/docker_images.yaml new file mode 100644 index 00000000..e47a0d9c --- /dev/null +++ b/.github/workflows/docker_images.yaml @@ -0,0 +1,61 @@ +# +name: docker_images +on: + push: + pull_request: +jobs: + get_meta: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: get_version + name: Get build metadata + run: | + ## Get workflow version as codebook env image version + echo "::set-output name=workflow_version::$(cat workflow/version.py | tail -1 | awk -F\' '{print $2}')" + - id: create_release + name: Create release + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'datajoint' + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + tag_name: ${{steps.get_version.outputs.workflow_version}} + release_name: Release ${{steps.get_version.outputs.workflow_version}} + body: Release ${{steps.get_version.outputs.workflow_version}} + draft: false + prerelease: false + outputs: + workflow_version: ${{steps.get_version.outputs.workflow_version}} + release_upload_url: ${{steps.create_release.outputs.upload_url}} + call_u24_docker_image_py39: + needs: [get_meta] + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + workflow_version: ${{needs.get_meta.outputs.workflow_version}} + release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} + secrets: + RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} + REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} + call_u24_docker_image_py38: + needs: [get_meta] + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.8 + dist: debian + workflow_version: ${{needs.get_meta.outputs.workflow_version}} + release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} + secrets: + RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} + REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} + +# diff --git a/.gitignore b/.gitignore index f0ced74f..bc4ca545 100644 --- a/.gitignore +++ b/.gitignore @@ -118,6 +118,7 @@ Diagram.ipynb # docker .env +*.pem # vscode .vscode/settings.json diff --git a/docker/codebook.Dockerfile b/docker/codebook.Dockerfile new file mode 100644 index 00000000..8c946f07 --- /dev/null +++ b/docker/codebook.Dockerfile @@ -0,0 +1,27 @@ +## docker build --build-arg JHUB_VER=1.4.2 --build-arg PY_VER=3.8 --build-arg DIST=debian --build-arg DEPLOY_KEY=workflow-array-ephys-deploy.pem --build-arg REPO_OWNER=datajoint --build-arg REPO_NAME=workflow-array-ephys -f codebook.Dockerfile -t registry.vathes.com/datajoint/codebook-workflow-array-ephys:v0.0.0 . + +## Single Stage +ARG JHUB_VER +ARG PY_VER +ARG DIST +FROM datajoint/djlabhub:${JHUB_VER}-py${PY_VER}-${DIST} + +USER root +RUN apt-get -y update && apt-get install -y ssh git + +ARG DEPLOY_KEY +USER anaconda:anaconda +COPY --chown=anaconda $DEPLOY_KEY $HOME/.ssh/datajoint_deploy.ssh + +ARG REPO_OWNER +ARG REPO_NAME +WORKDIR /tmp +RUN ssh-keyscan github.com >> $HOME/.ssh/known_hosts && \ + GIT_SSH_COMMAND="ssh -i $HOME/.ssh/datajoint_deploy.ssh" \ + git clone git@github.com:${REPO_OWNER}/${REPO_NAME}.git && \ + pip install ./${REPO_NAME} && \ + cp -r ./${REPO_NAME}/notebooks/ /home/ && \ + cp -r ./${REPO_NAME}/images/ /home/notebooks/ && \ + cp ./${REPO_NAME}/README.md /home/notebooks/ && \ + rm -rf /tmp/${REPO_NAME} +WORKDIR /home/notebooks diff --git a/docker/docker-compose-codebook_env.yaml b/docker/docker-compose-codebook_env.yaml new file mode 100644 index 00000000..51b63d93 --- /dev/null +++ b/docker/docker-compose-codebook_env.yaml @@ -0,0 +1,15 @@ +# docker-compose up --build +version: '2.4' +services: + codebook_env: + build: # only necessary if rebuilding image + context: . + dockerfile: codebook.Dockerfile + args: + - JHUB_VER + - PY_VER + - DIST + - DEPLOY_KEY + - REPO_OWNER + - REPO_NAME + image: registry.vathes.com/datajoint/codebook-${REPO_NAME}:jhub${JHUB_VER}-py${PY_VER}-${DIST}-v${WORKFLOW_VERSION} \ No newline at end of file From e655cf2b405b3b3268c72e432338d9a7c9af4079 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 25 Mar 2022 11:01:21 -0500 Subject: [PATCH 02/15] test --- .github/.staging_workflows/anchored_docker_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.staging_workflows/anchored_docker_images.yaml b/.github/.staging_workflows/anchored_docker_images.yaml index 95d931aa..714213b3 100644 --- a/.github/.staging_workflows/anchored_docker_images.yaml +++ b/.github/.staging_workflows/anchored_docker_images.yaml @@ -12,7 +12,7 @@ anchor-dev-if: &dev-if startsWith(github.ref, 'refs/tags') && github.repository_owner == 'yambottle' anchor-dev-workflow: &dev-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: Yambottle/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main ### For Github Action run in your own fork with release anchor-test-if: &test-if if: | From 257353eb5e137a3565bd640787d4a40f6129153e Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 25 Mar 2022 13:54:59 -0500 Subject: [PATCH 03/15] test --- .github/.staging_workflows/anchored_docker_images.yaml | 3 ++- .github/make-dev.sh | 2 ++ .github/{run-local.sh => run-act.sh} | 0 .github/workflows/docker_images.yaml | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .github/make-dev.sh rename .github/{run-local.sh => run-act.sh} (100%) diff --git a/.github/.staging_workflows/anchored_docker_images.yaml b/.github/.staging_workflows/anchored_docker_images.yaml index 714213b3..f6447495 100644 --- a/.github/.staging_workflows/anchored_docker_images.yaml +++ b/.github/.staging_workflows/anchored_docker_images.yaml @@ -45,7 +45,8 @@ jobs: name: Get build metadata run: | ## Get workflow version as codebook env image version - echo "::set-output name=workflow_version::$(cat workflow/version.py | tail -1 | awk -F\' '{print $2}')" + PACKAGE_DIR=$(ls | grep workflow) + echo "::set-output name=workflow_version::$(cat ${PACKAGE_DIR}/version.py | tail -1 | awk -F\' '{print $2}')" - id: create_release name: Create release !!merge <<: *$STAGE-if diff --git a/.github/make-dev.sh b/.github/make-dev.sh new file mode 100644 index 00000000..e9bdb38e --- /dev/null +++ b/.github/make-dev.sh @@ -0,0 +1,2 @@ +#!/bin/bash +bash ./.staging_workflows/normalize.sh dev \ No newline at end of file diff --git a/.github/run-local.sh b/.github/run-act.sh similarity index 100% rename from .github/run-local.sh rename to .github/run-act.sh diff --git a/.github/workflows/docker_images.yaml b/.github/workflows/docker_images.yaml index e47a0d9c..470ce320 100644 --- a/.github/workflows/docker_images.yaml +++ b/.github/workflows/docker_images.yaml @@ -12,7 +12,8 @@ jobs: name: Get build metadata run: | ## Get workflow version as codebook env image version - echo "::set-output name=workflow_version::$(cat workflow/version.py | tail -1 | awk -F\' '{print $2}')" + PACKAGE_DIR=$(ls | grep workflow) + echo "::set-output name=workflow_version::$(cat ${PACKAGE_DIR}/version.py | tail -1 | awk -F\' '{print $2}')" - id: create_release name: Create release if: | From 0eab06c31aa3400827aa09e846f43bbe67bbed8c Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 25 Mar 2022 13:57:50 -0500 Subject: [PATCH 04/15] test --- .github/workflows/docker_images.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_images.yaml b/.github/workflows/docker_images.yaml index 470ce320..7ebee658 100644 --- a/.github/workflows/docker_images.yaml +++ b/.github/workflows/docker_images.yaml @@ -19,7 +19,7 @@ jobs: if: | github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'datajoint' + github.repository_owner == 'yambottle' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -34,7 +34,7 @@ jobs: release_upload_url: ${{steps.create_release.outputs.upload_url}} call_u24_docker_image_py39: needs: [get_meta] - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: Yambottle/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9 @@ -47,7 +47,7 @@ jobs: REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} call_u24_docker_image_py38: needs: [get_meta] - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: Yambottle/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.8 From 5c5b18bd6426a5dcf1decfeb1c87f9151eed4ca7 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 25 Mar 2022 14:14:54 -0500 Subject: [PATCH 05/15] ci/cd is ready --- .github/workflows/docker_images.yaml | 6 +++--- docker/docker-compose-codebook_env.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_images.yaml b/.github/workflows/docker_images.yaml index 7ebee658..470ce320 100644 --- a/.github/workflows/docker_images.yaml +++ b/.github/workflows/docker_images.yaml @@ -19,7 +19,7 @@ jobs: if: | github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'yambottle' + github.repository_owner == 'datajoint' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -34,7 +34,7 @@ jobs: release_upload_url: ${{steps.create_release.outputs.upload_url}} call_u24_docker_image_py39: needs: [get_meta] - uses: Yambottle/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9 @@ -47,7 +47,7 @@ jobs: REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} call_u24_docker_image_py38: needs: [get_meta] - uses: Yambottle/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.8 diff --git a/docker/docker-compose-codebook_env.yaml b/docker/docker-compose-codebook_env.yaml index 51b63d93..03a77eb1 100644 --- a/docker/docker-compose-codebook_env.yaml +++ b/docker/docker-compose-codebook_env.yaml @@ -12,4 +12,4 @@ services: - DEPLOY_KEY - REPO_OWNER - REPO_NAME - image: registry.vathes.com/datajoint/codebook-${REPO_NAME}:jhub${JHUB_VER}-py${PY_VER}-${DIST}-v${WORKFLOW_VERSION} \ No newline at end of file + image: registry.vathes.com/${REPO_OWNER}/codebook-${REPO_NAME}:jhub${JHUB_VER}-py${PY_VER}-${DIST}-v${WORKFLOW_VERSION} \ No newline at end of file From b7579ac67f7ddf041db9e0cba5b0577fa426d7ee Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Tue, 23 Aug 2022 16:19:47 -0500 Subject: [PATCH 06/15] =?UTF-8?q?ci:=20=F0=9F=A7=AA=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anchored_docker_images.yaml | 23 +++++----------- .github/workflows/docker_images.yaml | 22 +++------------ docker/codebook.Dockerfile | 27 ------------------- docker/docker-compose-codebook_env.yaml | 15 ----------- 4 files changed, 10 insertions(+), 77 deletions(-) delete mode 100644 docker/codebook.Dockerfile delete mode 100644 docker/docker-compose-codebook_env.yaml diff --git a/.github/.staging_workflows/anchored_docker_images.yaml b/.github/.staging_workflows/anchored_docker_images.yaml index f6447495..a3401802 100644 --- a/.github/.staging_workflows/anchored_docker_images.yaml +++ b/.github/.staging_workflows/anchored_docker_images.yaml @@ -12,7 +12,7 @@ anchor-dev-if: &dev-if startsWith(github.ref, 'refs/tags') && github.repository_owner == 'yambottle' anchor-dev-workflow: &dev-workflow - uses: Yambottle/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: Yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main ### For Github Action run in your own fork with release anchor-test-if: &test-if if: | @@ -20,7 +20,7 @@ anchor-test-if: &test-if startsWith(github.ref, 'refs/tags') && github.repository_owner == 'yambottle' anchor-test-workflow: &test-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main ### For Github Action run in datajoint anchor-prod-if: &prod-if if: | @@ -28,7 +28,7 @@ anchor-prod-if: &prod-if startsWith(github.ref, 'refs/tags') && github.repository_owner == 'datajoint' anchor-prod-workflow: &prod-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main ### Common anchor anchor-workflow-secrets: &workflow-secrets secrets: @@ -46,7 +46,7 @@ jobs: run: | ## Get workflow version as codebook env image version PACKAGE_DIR=$(ls | grep workflow) - echo "::set-output name=workflow_version::$(cat ${PACKAGE_DIR}/version.py | tail -1 | awk -F\' '{print $2}')" + echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" - id: create_release name: Create release !!merge <<: *$STAGE-if @@ -70,18 +70,7 @@ jobs: jhub_ver: 1.4.2 py_ver: 3.9 dist: debian + codebook_base_hash: 561b765 workflow_version: ${{needs.get_meta.outputs.workflow_version}} release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} - !!merge <<: *workflow-secrets - call_u24_docker_image_py38: - needs: [get_meta] - !!merge <<: *$STAGE-workflow - with: - jhub_ver: 1.4.2 - py_ver: 3.8 - dist: debian - workflow_version: ${{needs.get_meta.outputs.workflow_version}} - release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} - !!merge <<: *workflow-secrets - -# \ No newline at end of file + !!merge <<: *workflow-secrets \ No newline at end of file diff --git a/.github/workflows/docker_images.yaml b/.github/workflows/docker_images.yaml index 470ce320..d0c3854f 100644 --- a/.github/workflows/docker_images.yaml +++ b/.github/workflows/docker_images.yaml @@ -13,13 +13,13 @@ jobs: run: | ## Get workflow version as codebook env image version PACKAGE_DIR=$(ls | grep workflow) - echo "::set-output name=workflow_version::$(cat ${PACKAGE_DIR}/version.py | tail -1 | awk -F\' '{print $2}')" + echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" - id: create_release name: Create release if: | github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'datajoint' + github.repository_owner == 'yambottle' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -34,29 +34,15 @@ jobs: release_upload_url: ${{steps.create_release.outputs.upload_url}} call_u24_docker_image_py39: needs: [get_meta] - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main + uses: Yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9 dist: debian + codebook_base_hash: 561b765 workflow_version: ${{needs.get_meta.outputs.workflow_version}} release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} secrets: RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} - call_u24_docker_image_py38: - needs: [get_meta] - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_docker_images.yaml@main - with: - jhub_ver: 1.4.2 - py_ver: 3.8 - dist: debian - workflow_version: ${{needs.get_meta.outputs.workflow_version}} - release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} - secrets: - RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} - REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} - REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} - -# diff --git a/docker/codebook.Dockerfile b/docker/codebook.Dockerfile deleted file mode 100644 index 8c946f07..00000000 --- a/docker/codebook.Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -## docker build --build-arg JHUB_VER=1.4.2 --build-arg PY_VER=3.8 --build-arg DIST=debian --build-arg DEPLOY_KEY=workflow-array-ephys-deploy.pem --build-arg REPO_OWNER=datajoint --build-arg REPO_NAME=workflow-array-ephys -f codebook.Dockerfile -t registry.vathes.com/datajoint/codebook-workflow-array-ephys:v0.0.0 . - -## Single Stage -ARG JHUB_VER -ARG PY_VER -ARG DIST -FROM datajoint/djlabhub:${JHUB_VER}-py${PY_VER}-${DIST} - -USER root -RUN apt-get -y update && apt-get install -y ssh git - -ARG DEPLOY_KEY -USER anaconda:anaconda -COPY --chown=anaconda $DEPLOY_KEY $HOME/.ssh/datajoint_deploy.ssh - -ARG REPO_OWNER -ARG REPO_NAME -WORKDIR /tmp -RUN ssh-keyscan github.com >> $HOME/.ssh/known_hosts && \ - GIT_SSH_COMMAND="ssh -i $HOME/.ssh/datajoint_deploy.ssh" \ - git clone git@github.com:${REPO_OWNER}/${REPO_NAME}.git && \ - pip install ./${REPO_NAME} && \ - cp -r ./${REPO_NAME}/notebooks/ /home/ && \ - cp -r ./${REPO_NAME}/images/ /home/notebooks/ && \ - cp ./${REPO_NAME}/README.md /home/notebooks/ && \ - rm -rf /tmp/${REPO_NAME} -WORKDIR /home/notebooks diff --git a/docker/docker-compose-codebook_env.yaml b/docker/docker-compose-codebook_env.yaml deleted file mode 100644 index 03a77eb1..00000000 --- a/docker/docker-compose-codebook_env.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# docker-compose up --build -version: '2.4' -services: - codebook_env: - build: # only necessary if rebuilding image - context: . - dockerfile: codebook.Dockerfile - args: - - JHUB_VER - - PY_VER - - DIST - - DEPLOY_KEY - - REPO_OWNER - - REPO_NAME - image: registry.vathes.com/${REPO_OWNER}/codebook-${REPO_NAME}:jhub${JHUB_VER}-py${PY_VER}-${DIST}-v${WORKFLOW_VERSION} \ No newline at end of file From c4d64ec185da8f324c280058af6865329821b243 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Tue, 23 Aug 2022 16:29:42 -0500 Subject: [PATCH 07/15] =?UTF-8?q?ci:=20=F0=9F=A7=AA=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anchored_docker_images.yaml | 76 ------------------- .../anchored_u24_workflow_before_release.yaml | 69 +++++++++++++++++ .github/workflows/docker_images.yaml | 48 ------------ .../u24_workflow_before_release.yaml | 40 ++++++++++ 4 files changed, 109 insertions(+), 124 deletions(-) delete mode 100644 .github/.staging_workflows/anchored_docker_images.yaml create mode 100644 .github/.staging_workflows/anchored_u24_workflow_before_release.yaml delete mode 100644 .github/workflows/docker_images.yaml create mode 100644 .github/workflows/u24_workflow_before_release.yaml diff --git a/.github/.staging_workflows/anchored_docker_images.yaml b/.github/.staging_workflows/anchored_docker_images.yaml deleted file mode 100644 index a3401802..00000000 --- a/.github/.staging_workflows/anchored_docker_images.yaml +++ /dev/null @@ -1,76 +0,0 @@ -# - -name: docker_images -on: - push: - pull_request: - -### For act testing locally -anchor-dev-if: &dev-if - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'yambottle' -anchor-dev-workflow: &dev-workflow - uses: Yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main -### For Github Action run in your own fork with release -anchor-test-if: &test-if - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'yambottle' -anchor-test-workflow: &test-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main -### For Github Action run in datajoint -anchor-prod-if: &prod-if - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'datajoint' -anchor-prod-workflow: &prod-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main -### Common anchor -anchor-workflow-secrets: &workflow-secrets - secrets: - RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} - REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} - REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} - -jobs: - get_meta: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - id: get_version - name: Get build metadata - run: | - ## Get workflow version as codebook env image version - PACKAGE_DIR=$(ls | grep workflow) - echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" - - id: create_release - name: Create release - !!merge <<: *$STAGE-if - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - tag_name: ${{steps.get_version.outputs.workflow_version}} - release_name: Release ${{steps.get_version.outputs.workflow_version}} - body: Release ${{steps.get_version.outputs.workflow_version}} - draft: false - prerelease: false - outputs: - workflow_version: ${{steps.get_version.outputs.workflow_version}} - release_upload_url: ${{steps.create_release.outputs.upload_url}} - - call_u24_docker_image_py39: - needs: [get_meta] - !!merge <<: *$STAGE-workflow - with: - jhub_ver: 1.4.2 - py_ver: 3.9 - dist: debian - codebook_base_hash: 561b765 - workflow_version: ${{needs.get_meta.outputs.workflow_version}} - release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} - !!merge <<: *workflow-secrets \ No newline at end of file diff --git a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml new file mode 100644 index 00000000..5348fdb8 --- /dev/null +++ b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml @@ -0,0 +1,69 @@ +# + +name: u24_workflow_before_release +on: + push: + pull_request: + +### For act testing locally +anchor-dev-if: &dev-if + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'yambottle' +anchor-dev-workflow: &dev-workflow + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main +### For Github Action run in your own fork with release +anchor-test-if: &test-if + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'yambottle' +anchor-test-workflow: &test-workflow + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main +### For Github Action run in datajoint +anchor-prod-if: &prod-if + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') && + github.repository_owner == 'datajoint' +anchor-prod-workflow: &prod-workflow + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +jobs: + # get_meta: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - id: get_version + # name: Get build metadata + # run: | + # ## Get workflow version as codebook env image version + # PACKAGE_DIR=$(ls | grep workflow) + # echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" + # - id: create_release + # name: Create release + # !!merge <<: *$STAGE-if + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + # with: + # tag_name: ${{steps.get_version.outputs.workflow_version}} + # release_name: Release ${{steps.get_version.outputs.workflow_version}} + # body: Release ${{steps.get_version.outputs.workflow_version}} + # draft: false + # prerelease: false + # outputs: + # workflow_version: ${{steps.get_version.outputs.workflow_version}} + # release_upload_url: ${{steps.create_release.outputs.upload_url}} + + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + + call_u24_docker_image_py39: + !!merge <<: *$STAGE-workflow + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 \ No newline at end of file diff --git a/.github/workflows/docker_images.yaml b/.github/workflows/docker_images.yaml deleted file mode 100644 index d0c3854f..00000000 --- a/.github/workflows/docker_images.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# -name: docker_images -on: - push: - pull_request: -jobs: - get_meta: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - id: get_version - name: Get build metadata - run: | - ## Get workflow version as codebook env image version - PACKAGE_DIR=$(ls | grep workflow) - echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" - - id: create_release - name: Create release - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'yambottle' - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - tag_name: ${{steps.get_version.outputs.workflow_version}} - release_name: Release ${{steps.get_version.outputs.workflow_version}} - body: Release ${{steps.get_version.outputs.workflow_version}} - draft: false - prerelease: false - outputs: - workflow_version: ${{steps.get_version.outputs.workflow_version}} - release_upload_url: ${{steps.create_release.outputs.upload_url}} - call_u24_docker_image_py39: - needs: [get_meta] - uses: Yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main - with: - jhub_ver: 1.4.2 - py_ver: 3.9 - dist: debian - codebook_base_hash: 561b765 - workflow_version: ${{needs.get_meta.outputs.workflow_version}} - release_upload_url: ${{needs.get_meta.outputs.release_upload_url}} - secrets: - RAW_DEPLOY_KEY: ${{secrets.RAW_DEPLOY_KEY}} - REGISTRY_USERNAME: ${{secrets.REGISTRY_USERNAME}} - REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}} diff --git a/.github/workflows/u24_workflow_before_release.yaml b/.github/workflows/u24_workflow_before_release.yaml new file mode 100644 index 00000000..d8b6b54b --- /dev/null +++ b/.github/workflows/u24_workflow_before_release.yaml @@ -0,0 +1,40 @@ +# +name: u24_workflow_before_release +on: + push: + pull_request: +jobs: + # get_meta: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - id: get_version + # name: Get build metadata + # run: | + # ## Get workflow version as codebook env image version + # PACKAGE_DIR=$(ls | grep workflow) + # echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" + # - id: create_release + # name: Create release + # !!merge <<: *dev-if + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + # with: + # tag_name: ${{steps.get_version.outputs.workflow_version}} + # release_name: Release ${{steps.get_version.outputs.workflow_version}} + # body: Release ${{steps.get_version.outputs.workflow_version}} + # draft: false + # prerelease: false + # outputs: + # workflow_version: ${{steps.get_version.outputs.workflow_version}} + # release_upload_url: ${{steps.create_release.outputs.upload_url}} + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_docker_image_py39: + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 From 9953ff5da17040081142be6f274dd5c861a2996a Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Tue, 23 Aug 2022 16:32:05 -0500 Subject: [PATCH 08/15] =?UTF-8?q?ci:=20=F0=9F=A7=AA=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anchored_u24_workflow_before_release.yaml | 7 ++++++- .github/workflows/u24_workflow_before_release.yaml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml index 5348fdb8..419950dc 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml @@ -2,8 +2,13 @@ name: u24_workflow_before_release on: - push: pull_request: + push: + branches: + - '**' + tags-ignore: + - '**' + workflow_dispatch: ### For act testing locally anchor-dev-if: &dev-if diff --git a/.github/workflows/u24_workflow_before_release.yaml b/.github/workflows/u24_workflow_before_release.yaml index d8b6b54b..517a139d 100644 --- a/.github/workflows/u24_workflow_before_release.yaml +++ b/.github/workflows/u24_workflow_before_release.yaml @@ -1,8 +1,13 @@ # name: u24_workflow_before_release on: - push: pull_request: + push: + branches: + - '**' + tags-ignore: + - '**' + workflow_dispatch: jobs: # get_meta: # runs-on: ubuntu-latest From ac0ba1f39620b952935b5e604b78a57f0205f5b3 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Tue, 23 Aug 2022 16:53:49 -0500 Subject: [PATCH 09/15] =?UTF-8?q?ci:=20=F0=9F=A7=AA=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anchored_u24_workflow_before_release.yaml | 55 +------------------ .../u24_workflow_before_release.yaml | 26 --------- 2 files changed, 1 insertion(+), 80 deletions(-) diff --git a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml index 419950dc..059cd8b3 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml @@ -1,5 +1,3 @@ -# - name: u24_workflow_before_release on: pull_request: @@ -10,63 +8,12 @@ on: - '**' workflow_dispatch: -### For act testing locally -anchor-dev-if: &dev-if - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'yambottle' -anchor-dev-workflow: &dev-workflow - uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main -### For Github Action run in your own fork with release -anchor-test-if: &test-if - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'yambottle' -anchor-test-workflow: &test-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main -### For Github Action run in datajoint -anchor-prod-if: &prod-if - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') && - github.repository_owner == 'datajoint' -anchor-prod-workflow: &prod-workflow - uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main - jobs: - # get_meta: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - id: get_version - # name: Get build metadata - # run: | - # ## Get workflow version as codebook env image version - # PACKAGE_DIR=$(ls | grep workflow) - # echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" - # - id: create_release - # name: Create release - # !!merge <<: *$STAGE-if - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - # with: - # tag_name: ${{steps.get_version.outputs.workflow_version}} - # release_name: Release ${{steps.get_version.outputs.workflow_version}} - # body: Release ${{steps.get_version.outputs.workflow_version}} - # draft: false - # prerelease: false - # outputs: - # workflow_version: ${{steps.get_version.outputs.workflow_version}} - # release_upload_url: ${{steps.create_release.outputs.upload_url}} - call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main call_u24_docker_image_py39: - !!merge <<: *$STAGE-workflow + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9 diff --git a/.github/workflows/u24_workflow_before_release.yaml b/.github/workflows/u24_workflow_before_release.yaml index 517a139d..273ce940 100644 --- a/.github/workflows/u24_workflow_before_release.yaml +++ b/.github/workflows/u24_workflow_before_release.yaml @@ -1,4 +1,3 @@ -# name: u24_workflow_before_release on: pull_request: @@ -9,31 +8,6 @@ on: - '**' workflow_dispatch: jobs: - # get_meta: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - id: get_version - # name: Get build metadata - # run: | - # ## Get workflow version as codebook env image version - # PACKAGE_DIR=$(ls | grep workflow) - # echo "::set-output name=workflow_version::$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')" - # - id: create_release - # name: Create release - # !!merge <<: *dev-if - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - # with: - # tag_name: ${{steps.get_version.outputs.workflow_version}} - # release_name: Release ${{steps.get_version.outputs.workflow_version}} - # body: Release ${{steps.get_version.outputs.workflow_version}} - # draft: false - # prerelease: false - # outputs: - # workflow_version: ${{steps.get_version.outputs.workflow_version}} - # release_upload_url: ${{steps.create_release.outputs.upload_url}} call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main call_u24_docker_image_py39: From 4d4f3740c8d3f5bb487a0fec000aa31f9f3a006a Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Wed, 24 Aug 2022 17:46:40 -0500 Subject: [PATCH 10/15] =?UTF-8?q?feat:=20=E2=9C=A8=20update=20release=20pi?= =?UTF-8?q?peline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anchored_u24_workflow_before_release.yaml | 11 ++++- .../anchored_u24_workflow_release_call.yaml | 46 +++++++++++++++++++ .../anchored_u24_workflow_tag_to_release.yaml | 27 +++++++++++ .../workflows/u24_workflow_release_call.yaml | 20 ++++++++ .../u24_workflow_tag_to_release.yaml | 16 +++++++ 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 .github/.staging_workflows/anchored_u24_workflow_release_call.yaml create mode 100644 .github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml create mode 100644 .github/workflows/u24_workflow_release_call.yaml create mode 100644 .github/workflows/u24_workflow_tag_to_release.yaml diff --git a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml index 059cd8b3..30cb7494 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml @@ -8,12 +8,21 @@ on: - '**' workflow_dispatch: +anchor-dev-build-call: &dev-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-test-build-call: &test-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-prod-build-call: &prod-build-call + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main call_u24_docker_image_py39: - uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + !!merge <<: *$STAGE-build-call with: jhub_ver: 1.4.2 py_ver: 3.9 diff --git a/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml new file mode 100644 index 00000000..a4000fbf --- /dev/null +++ b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml @@ -0,0 +1,46 @@ +name: u24_workflow_release_call + +on: + workflow_run: + workflows: ["u24_workflow_tag_to_release"] + types: + - completed + +anchor-dev-release-call: &dev-release-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + +anchor-test-release-call: &test-release-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + +anchor-prod-release-call: &prod-release-call + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + +anchor-dev-release-if: &dev-release-if + if: >- + github.event.workflow_run.conclusion == 'success' && + github.repository_owner == 'yambottle' + +anchor-test-release-if: &test-release-if + if: >- + github.event.workflow_run.conclusion == 'success' && + github.repository_owner == 'yambottle' + +anchor-prod-release-if: &prod-release-if + if: >- + github.event.workflow_run.conclusion == 'success' && + github.repository_owner == 'datajoint' + +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + + call_u24_elements_release_alpine: + !!merge <<: *$STAGE-release-if + !!merge <<: *$STAGE-release-call + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + secrets: + REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} \ No newline at end of file diff --git a/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml new file mode 100644 index 00000000..4893a316 --- /dev/null +++ b/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml @@ -0,0 +1,27 @@ +name: u24_workflow_tag_to_release + +on: + push: + tags: + - '*.*.*' + - 'test*.*.*' + +anchor-dev-build-call: &dev-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-test-build-call: &test-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-prod-build-call: &prod-build-call + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_workflow_build_alpine: + !!merge <<: *$STAGE-build-call + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 \ No newline at end of file diff --git a/.github/workflows/u24_workflow_release_call.yaml b/.github/workflows/u24_workflow_release_call.yaml new file mode 100644 index 00000000..c5aea581 --- /dev/null +++ b/.github/workflows/u24_workflow_release_call.yaml @@ -0,0 +1,20 @@ +name: u24_workflow_release_call +on: + workflow_run: + workflows: ["u24_workflow_tag_to_release"] + types: + - completed +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_elements_release_alpine: + if: >- + github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'yambottle' + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + secrets: + REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} diff --git a/.github/workflows/u24_workflow_tag_to_release.yaml b/.github/workflows/u24_workflow_tag_to_release.yaml new file mode 100644 index 00000000..a8ac1552 --- /dev/null +++ b/.github/workflows/u24_workflow_tag_to_release.yaml @@ -0,0 +1,16 @@ +name: u24_workflow_tag_to_release +on: + push: + tags: + - '*.*.*' + - 'test*.*.*' +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_workflow_build_alpine: + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 From 3875d1a25c4c164c4d644dde04c18805b050f67e Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Wed, 24 Aug 2022 19:16:51 -0500 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20docker=20load=20inv?= =?UTF-8?q?alid=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.staging_workflows/anchored_u24_workflow_release_call.yaml | 1 + .github/workflows/u24_workflow_release_call.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml index a4000fbf..4a3b6b6c 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml @@ -41,6 +41,7 @@ jobs: jhub_ver: 1.4.2 py_ver: 3.9 dist: debian + codebook_base_hash: 561b765 secrets: REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} \ No newline at end of file diff --git a/.github/workflows/u24_workflow_release_call.yaml b/.github/workflows/u24_workflow_release_call.yaml index c5aea581..af2c7553 100644 --- a/.github/workflows/u24_workflow_release_call.yaml +++ b/.github/workflows/u24_workflow_release_call.yaml @@ -15,6 +15,7 @@ jobs: jhub_ver: 1.4.2 py_ver: 3.9 dist: debian + codebook_base_hash: 561b765 secrets: REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} From e3494f64135daa76670452e7b75b893bde8127f2 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Wed, 24 Aug 2022 19:43:05 -0500 Subject: [PATCH 12/15] fix: --- .../anchored_u24_workflow_before_release.yaml | 2 +- .../.staging_workflows/anchored_u24_workflow_release_call.yaml | 2 +- .../anchored_u24_workflow_tag_to_release.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml index 30cb7494..14a345b6 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml @@ -21,7 +21,7 @@ jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main - call_u24_docker_image_py39: + call_u24_workflow_build_debian: !!merge <<: *$STAGE-build-call with: jhub_ver: 1.4.2 diff --git a/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml index 4a3b6b6c..fd22db18 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml @@ -34,7 +34,7 @@ jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main - call_u24_elements_release_alpine: + call_u24_workflow_release_debian: !!merge <<: *$STAGE-release-if !!merge <<: *$STAGE-release-call with: diff --git a/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml index 4893a316..ade13755 100644 --- a/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml +++ b/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml @@ -18,7 +18,7 @@ anchor-prod-build-call: &prod-build-call jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main - call_u24_workflow_build_alpine: + call_u24_workflow_build_debian: !!merge <<: *$STAGE-build-call with: jhub_ver: 1.4.2 From 9c368ec4a5c580b02bb7f234c12d348ec87f5144 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Wed, 24 Aug 2022 19:46:37 -0500 Subject: [PATCH 13/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20changelog=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1326a294..5fd67d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,5 +53,6 @@ specific forks for tests. + Add - Version -[0.2.0]: https://github.com/datajoint/workflow-array-ephys/releases/tag/0.2.0 +[0.2.1]: https://github.com/datajoint/workflow-array-ephys/compare/0.2.1...0.2.0 +[0.2.0]: https://github.com/datajoint/workflow-array-ephys/compare/0.2.0...0.1.0 [0.1.0]: https://github.com/datajoint/workflow-array-ephys/releases/tag/0.1.0 \ No newline at end of file From 39cf9129c592728a78616a0df464ac9beaf53748 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Wed, 24 Aug 2022 19:52:58 -0500 Subject: [PATCH 14/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20update=20job=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/u24_workflow_before_release.yaml | 2 +- .github/workflows/u24_workflow_release_call.yaml | 2 +- .github/workflows/u24_workflow_tag_to_release.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/u24_workflow_before_release.yaml b/.github/workflows/u24_workflow_before_release.yaml index 273ce940..4cfe1d66 100644 --- a/.github/workflows/u24_workflow_before_release.yaml +++ b/.github/workflows/u24_workflow_before_release.yaml @@ -10,7 +10,7 @@ on: jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main - call_u24_docker_image_py39: + call_u24_workflow_build_debian: uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main with: jhub_ver: 1.4.2 diff --git a/.github/workflows/u24_workflow_release_call.yaml b/.github/workflows/u24_workflow_release_call.yaml index af2c7553..10f33cc7 100644 --- a/.github/workflows/u24_workflow_release_call.yaml +++ b/.github/workflows/u24_workflow_release_call.yaml @@ -7,7 +7,7 @@ on: jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main - call_u24_elements_release_alpine: + call_u24_workflow_release_debian: if: >- github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'yambottle' uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main diff --git a/.github/workflows/u24_workflow_tag_to_release.yaml b/.github/workflows/u24_workflow_tag_to_release.yaml index a8ac1552..bf2aea02 100644 --- a/.github/workflows/u24_workflow_tag_to_release.yaml +++ b/.github/workflows/u24_workflow_tag_to_release.yaml @@ -7,7 +7,7 @@ on: jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main - call_u24_workflow_build_alpine: + call_u24_workflow_build_debian: uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main with: jhub_ver: 1.4.2 From 64a345d35b3ce8acaee7bc99777608fc419b34f4 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Thu, 25 Aug 2022 09:32:47 -0500 Subject: [PATCH 15/15] =?UTF-8?q?feat:=20=E2=9C=A8=20prod=20cicd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/u24_workflow_before_release.yaml | 2 +- .github/workflows/u24_workflow_release_call.yaml | 4 ++-- .github/workflows/u24_workflow_tag_to_release.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/u24_workflow_before_release.yaml b/.github/workflows/u24_workflow_before_release.yaml index 4cfe1d66..ab7d8ce1 100644 --- a/.github/workflows/u24_workflow_before_release.yaml +++ b/.github/workflows/u24_workflow_before_release.yaml @@ -11,7 +11,7 @@ jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main call_u24_workflow_build_debian: - uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9 diff --git a/.github/workflows/u24_workflow_release_call.yaml b/.github/workflows/u24_workflow_release_call.yaml index 10f33cc7..f440c11e 100644 --- a/.github/workflows/u24_workflow_release_call.yaml +++ b/.github/workflows/u24_workflow_release_call.yaml @@ -9,8 +9,8 @@ jobs: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main call_u24_workflow_release_debian: if: >- - github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'yambottle' - uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'datajoint' + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9 diff --git a/.github/workflows/u24_workflow_tag_to_release.yaml b/.github/workflows/u24_workflow_tag_to_release.yaml index bf2aea02..3dd9bace 100644 --- a/.github/workflows/u24_workflow_tag_to_release.yaml +++ b/.github/workflows/u24_workflow_tag_to_release.yaml @@ -8,7 +8,7 @@ jobs: call_context_check: uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main call_u24_workflow_build_debian: - uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main with: jhub_ver: 1.4.2 py_ver: 3.9