mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 07:22:57 +00:00
Refactor handling of artifacts (#1930)
This commit is contained in:
7
.github/actions/load-image/action.yml
vendored
7
.github/actions/load-image/action.yml
vendored
@@ -18,13 +18,12 @@ runs:
|
|||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-${{ inputs.platform }}
|
name: ${{ inputs.image }}-${{ inputs.platform }}
|
||||||
path: /tmp/
|
path: /tmp/jupyter/images/
|
||||||
- name: Load downloaded image to docker 📥
|
- name: Load downloaded image to docker 📥
|
||||||
run: |
|
run: |
|
||||||
docker load --input /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
|
docker load --input /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}.tar
|
||||||
docker image ls --all
|
docker image ls --all
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Delete the file 🗑️
|
- name: Delete the file 🗑️
|
||||||
run: rm -f /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
|
run: rm /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}.tar
|
||||||
shell: bash
|
shell: bash
|
||||||
if: always()
|
|
||||||
|
27
.github/workflows/docker-build-test-upload.yml
vendored
27
.github/workflows/docker-build-test-upload.yml
vendored
@@ -44,9 +44,7 @@ jobs:
|
|||||||
docker kill $(docker ps --quiet) || true
|
docker kill $(docker ps --quiet) || true
|
||||||
docker rm $(docker ps --all --quiet) || true
|
docker rm $(docker ps --all --quiet) || true
|
||||||
docker system prune --all --force
|
docker system prune --all --force
|
||||||
rm -rf /tmp/tags/
|
rm -rf /tmp/jupyter/
|
||||||
rm -rf /tmp/hist_lines/
|
|
||||||
rm -rf /tmp/manifests/
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Load parent built image to Docker 📥
|
- name: Load parent built image to Docker 📥
|
||||||
@@ -70,44 +68,39 @@ jobs:
|
|||||||
|
|
||||||
- name: Write tags file 🏷
|
- name: Write tags file 🏷
|
||||||
run: |
|
run: |
|
||||||
python3 -m tagging.write_tags_file --short-image-name ${{ inputs.image }} --tags-dir /tmp/tags/ --owner ${{ env.OWNER }}
|
python3 -m tagging.write_tags_file --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/ --owner ${{ env.OWNER }}
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Upload tags file 💾
|
- name: Upload tags file 💾
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-${{ inputs.platform }}-tags
|
name: ${{ inputs.image }}-${{ inputs.platform }}-tags
|
||||||
path: /tmp/tags/${{ inputs.platform }}-${{ inputs.image }}.txt
|
path: /tmp/jupyter/tags/${{ inputs.platform }}-${{ inputs.image }}.txt
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|
||||||
- name: Write manifest and build history file 🏷
|
- name: Write manifest and build history file 🏷
|
||||||
run: python3 -m tagging.write_manifest --short-image-name ${{ inputs.image }} --hist-line-dir /tmp/hist_lines/ --manifest-dir /tmp/manifests/ --owner ${{ env.OWNER }}
|
run: python3 -m tagging.write_manifest --short-image-name ${{ inputs.image }} --hist-line-dir /tmp/jupyter/hist_lines/ --manifest-dir /tmp/jupyter/manifests/ --owner ${{ env.OWNER }}
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Upload manifest file 💾
|
- name: Upload manifest file 💾
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-${{ inputs.platform }}-manifest
|
name: ${{ inputs.image }}-${{ inputs.platform }}-manifest
|
||||||
path: /tmp/manifests/${{ inputs.platform }}-${{ inputs.image }}-*.md
|
path: /tmp/jupyter/manifests/${{ inputs.platform }}-${{ inputs.image }}-*.md
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
- name: Upload build history line 💾
|
- name: Upload build history line 💾
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-${{ inputs.platform }}-history_line
|
name: ${{ inputs.image }}-${{ inputs.platform }}-history_line
|
||||||
path: /tmp/hist_lines/${{ inputs.platform }}-${{ inputs.image }}-*.txt
|
path: /tmp/jupyter/hist_lines/${{ inputs.platform }}-${{ inputs.image }}-*.txt
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|
||||||
- name: Save image as a tar for later use 💾
|
- name: Save image as a tar for later use 💾
|
||||||
run: docker save ${{ env.OWNER }}/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
|
run: |
|
||||||
|
mkdir -p /tmp/jupyter/images/
|
||||||
|
docker save ${{ env.OWNER }}/${{ inputs.image }} -o /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}.tar
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Upload image as artifact 💾
|
- name: Upload image as artifact 💾
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-${{ inputs.platform }}
|
name: ${{ inputs.image }}-${{ inputs.platform }}
|
||||||
path: /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
|
path: /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}.tar
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|
||||||
# Self-hosted runners share a state (whole VM) between runs
|
|
||||||
- name: Cleanup artifacts 🗑️
|
|
||||||
run: |
|
|
||||||
rm -f /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
|
|
||||||
shell: bash
|
|
||||||
if: always()
|
|
||||||
|
6
.github/workflows/docker-merge-tags.yml
vendored
6
.github/workflows/docker-merge-tags.yml
vendored
@@ -32,12 +32,12 @@ jobs:
|
|||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-x86_64-tags
|
name: ${{ inputs.image }}-x86_64-tags
|
||||||
path: /tmp/tags/
|
path: /tmp/jupyter/tags/
|
||||||
- name: Download aarch64 tags file 📥
|
- name: Download aarch64 tags file 📥
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-aarch64-tags
|
name: ${{ inputs.image }}-aarch64-tags
|
||||||
path: /tmp/tags/
|
path: /tmp/jupyter/tags/
|
||||||
|
|
||||||
# Docker might be stuck when pulling images
|
# Docker might be stuck when pulling images
|
||||||
# https://github.com/docker/for-mac/issues/2083
|
# https://github.com/docker/for-mac/issues/2083
|
||||||
@@ -57,5 +57,5 @@ jobs:
|
|||||||
|
|
||||||
- name: Merge tags for the images 🔀
|
- name: Merge tags for the images 🔀
|
||||||
if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule')
|
if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule')
|
||||||
run: python3 -m tagging.merge_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/tags/
|
run: python3 -m tagging.merge_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/
|
||||||
shell: bash
|
shell: bash
|
||||||
|
4
.github/workflows/docker-tag-push.yml
vendored
4
.github/workflows/docker-tag-push.yml
vendored
@@ -48,9 +48,9 @@ jobs:
|
|||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.image }}-${{ inputs.platform }}-tags
|
name: ${{ inputs.image }}-${{ inputs.platform }}-tags
|
||||||
path: /tmp/tags/
|
path: /tmp/jupyter/tags/
|
||||||
- name: Apply tags to the loaded image 🏷
|
- name: Apply tags to the loaded image 🏷
|
||||||
run: python3 -m tagging.apply_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/tags/ --platform ${{ inputs.platform }} --owner ${{ env.OWNER }}
|
run: python3 -m tagging.apply_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/ --platform ${{ inputs.platform }} --owner ${{ env.OWNER }}
|
||||||
|
|
||||||
- name: Push Images to Docker Hub 📤
|
- name: Push Images to Docker Hub 📤
|
||||||
if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule')
|
if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule')
|
||||||
|
10
.github/workflows/docker-wiki-update.yml
vendored
10
.github/workflows/docker-wiki-update.yml
vendored
@@ -20,12 +20,12 @@ jobs:
|
|||||||
- name: Download all manifests and history lines 📥
|
- name: Download all manifests and history lines 📥
|
||||||
uses: ./.github/actions/download-manifests
|
uses: ./.github/actions/download-manifests
|
||||||
with:
|
with:
|
||||||
histLineDir: /tmp/hist_lines/
|
histLineDir: /tmp/jupyter/hist_lines/
|
||||||
manifestDir: /tmp/manifests/
|
manifestDir: /tmp/jupyter/manifests/
|
||||||
- name: Display structure of downloaded files 🔍️
|
- name: Display structure of downloaded files 🔍️
|
||||||
run: |
|
run: |
|
||||||
ls -R /tmp/hist_lines/
|
ls -R /tmp/jupyter/hist_lines/
|
||||||
ls -R /tmp/manifests/
|
ls -R /tmp/jupyter/manifests/
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Checkout Wiki Repo 📃
|
- name: Checkout Wiki Repo 📃
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
path: wiki/
|
path: wiki/
|
||||||
|
|
||||||
- name: Update wiki page 🏷
|
- name: Update wiki page 🏷
|
||||||
run: python3 -m tagging.update_wiki_page --wiki-dir wiki/ --hist-line-dir /tmp/hist_lines/ --manifest-dir /tmp/manifests/
|
run: python3 -m tagging.update_wiki_page --wiki-dir wiki/ --hist-line-dir /tmp/jupyter/hist_lines/ --manifest-dir /tmp/jupyter/manifests/
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Push Wiki to GitHub 📤
|
- name: Push Wiki to GitHub 📤
|
||||||
|
2
Makefile
2
Makefile
@@ -69,7 +69,7 @@ linkcheck-docs: ## check broken links
|
|||||||
|
|
||||||
hook/%: ## run post-build hooks for an image
|
hook/%: ## run post-build hooks for an image
|
||||||
python3 -m tagging.tag_image --short-image-name "$(notdir $@)" --owner "$(OWNER)" && \
|
python3 -m tagging.tag_image --short-image-name "$(notdir $@)" --owner "$(OWNER)" && \
|
||||||
python3 -m tagging.write_manifest --short-image-name "$(notdir $@)" --hist-line-dir /tmp/hist_lines/ --manifest-dir /tmp/manifests/ --owner "$(OWNER)"
|
python3 -m tagging.write_manifest --short-image-name "$(notdir $@)" --hist-line-dir /tmp/jupyter/hist_lines/ --manifest-dir /tmp/jupyter/manifests/ --owner "$(OWNER)"
|
||||||
hook-all: $(foreach I, $(ALL_IMAGES), hook/$(I)) ## run post-build hooks for all images
|
hook-all: $(foreach I, $(ALL_IMAGES), hook/$(I)) ## run post-build hooks for all images
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user