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

Implement build system using self-hosted aarch64 runners, GitHub needs jobs feature and reusable workflows #1703

Merged
merged 137 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
c1a91ff
Completely refactor build system
mathbunnyru May 12, 2022
fa266fc
Add shell
mathbunnyru May 12, 2022
7304556
Move shell before run
mathbunnyru May 12, 2022
49f9c0e
Try composite action
mathbunnyru May 12, 2022
c078abe
Actually build image and uplad as artifact
mathbunnyru May 12, 2022
74b5903
Add icon
mathbunnyru May 12, 2022
33fdc63
Better dependencies
mathbunnyru May 12, 2022
f90de5e
Fix naming
mathbunnyru May 12, 2022
611c51f
Temporarily remove build space maximize
mathbunnyru May 12, 2022
157a980
Test the image
mathbunnyru May 12, 2022
ba90957
Remove old workflows
mathbunnyru May 12, 2022
f116921
Add build-push action
mathbunnyru May 12, 2022
8e27841
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru May 12, 2022
e68eaea
Remove permissions
mathbunnyru May 12, 2022
dfbe591
Add test-image action
mathbunnyru May 12, 2022
748dca4
Add missing shell
mathbunnyru May 12, 2022
48518b5
Add parent image support
mathbunnyru May 12, 2022
b7342e8
Implement reusable workflow for build
mathbunnyru May 12, 2022
5d57376
Fix reuseable workflow
mathbunnyru May 12, 2022
e51de12
Remove description
mathbunnyru May 12, 2022
b5a53e5
Fix
mathbunnyru May 12, 2022
45d4501
Add typing
mathbunnyru May 12, 2022
e70bebe
Implement test-image as a reusable workflow
mathbunnyru May 12, 2022
75feb62
Fix
mathbunnyru May 12, 2022
7c3e802
Add missing things
mathbunnyru May 12, 2022
ea35ff1
Build minimal notebook as well
mathbunnyru May 12, 2022
dbb9762
Add missing needs statement
mathbunnyru May 12, 2022
be2873c
Start adding platform support
mathbunnyru May 12, 2022
c9c9c46
Fix
mathbunnyru May 12, 2022
4b2904b
Type: choice is not yet supported
mathbunnyru May 12, 2022
58ffbfa
Add arm64 build jobs
mathbunnyru May 12, 2022
f1826e7
Fix build image platform choosing
mathbunnyru May 12, 2022
457225f
Fix
mathbunnyru May 12, 2022
a45feec
Better dependencies
mathbunnyru May 12, 2022
b2d3ba8
Increase test timeout
mathbunnyru May 12, 2022
82e5b2d
Increase test timeout
mathbunnyru May 12, 2022
dfb158a
Increase test timeout
mathbunnyru May 12, 2022
291950d
Try no to use buildx
mathbunnyru May 12, 2022
60263a1
Remove QEMU as well
mathbunnyru May 12, 2022
dcc00b4
Revert
mathbunnyru May 12, 2022
2fe3100
Try to use simple docker commands
mathbunnyru May 12, 2022
dea81a8
Fix
mathbunnyru May 12, 2022
ddb993a
Fix
mathbunnyru May 12, 2022
5b03f3a
Better build
mathbunnyru May 12, 2022
539159f
Add amd64 images tagging and push to DockerHub
mathbunnyru May 12, 2022
35bff63
Fix
mathbunnyru May 12, 2022
a8a7314
Better naming
mathbunnyru May 12, 2022
739003d
Refactor github workflows
mathbunnyru May 12, 2022
f7bc1c1
Fix
mathbunnyru May 12, 2022
a936129
Fix
mathbunnyru May 12, 2022
ec841b9
Better workflow name
mathbunnyru May 12, 2022
91b70a8
Better push workflow
mathbunnyru May 12, 2022
6322b79
Fix
mathbunnyru May 12, 2022
c5c38f9
Fix
mathbunnyru May 12, 2022
6ce871a
Fix
mathbunnyru May 12, 2022
edc115c
Refactor
mathbunnyru May 12, 2022
8e11fcd
Add tags prefix support
mathbunnyru May 12, 2022
b9e294c
Small refactor
mathbunnyru May 12, 2022
1170727
Rename workflows
mathbunnyru May 12, 2022
5ff0ecd
Upload manifests in workflow
mathbunnyru May 12, 2022
3bd4714
Fix
mathbunnyru May 12, 2022
3389922
Add args to call write_manifests
mathbunnyru May 12, 2022
f80d45c
Run only on base-notebook
mathbunnyru May 12, 2022
38eddd8
Fix
mathbunnyru May 12, 2022
4407e14
Fix hist lines dir
mathbunnyru May 12, 2022
f534a62
Add docker wiki workflow
mathbunnyru May 12, 2022
b5bfa8b
Fix
mathbunnyru May 12, 2022
616069d
Fix double tagging
mathbunnyru May 12, 2022
e6c598f
Run command from root
mathbunnyru May 12, 2022
a5203d8
Fix update_wiki_page.py
mathbunnyru May 12, 2022
36319f9
Wiki update fixes
mathbunnyru May 12, 2022
944664e
Fix typo
mathbunnyru May 12, 2022
0487c99
Cleanup docs about multi platform builds
mathbunnyru May 12, 2022
dbd5325
Improve wiki page update
mathbunnyru May 12, 2022
cfb7fd6
[TMP] Add test to check if image is freshly built
mathbunnyru May 12, 2022
b6e25f3
Enable minimal-notebook build
mathbunnyru May 13, 2022
3ce4312
Test all amd64 images
mathbunnyru May 13, 2022
940767e
Fix typo
mathbunnyru May 13, 2022
4b22cb0
Revert timeout increase because we don't use QEMU as now
mathbunnyru May 13, 2022
6ad55a3
Fix typo in docs
mathbunnyru May 13, 2022
6844487
Use better rglob to prevent future problems
mathbunnyru May 13, 2022
2db847f
Add docker build options
mathbunnyru May 13, 2022
25a82e5
Download only manifest files
mathbunnyru May 13, 2022
4f1d8a6
Fix paths
mathbunnyru May 13, 2022
7a37943
Set retention days on uploaded artifacts
mathbunnyru May 13, 2022
cd178aa
Move accidentally deleted file back
mathbunnyru May 13, 2022
ffe33b1
Better python code
mathbunnyru May 13, 2022
7543e49
Minor fixes
mathbunnyru May 13, 2022
26951ef
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru May 13, 2022
3ef0cf8
Remove downloaded file and do not maximize build space
mathbunnyru May 13, 2022
cd61560
Update .github/actions/load-image/action.yml
mathbunnyru May 18, 2022
bf7e7fd
Update .github/workflows/docker-build-upload.yml
mathbunnyru May 18, 2022
f2c4550
Update .github/workflows/docker-build-upload.yml
mathbunnyru May 18, 2022
927cbf8
Update .github/workflows/docker-build-upload.yml
mathbunnyru May 18, 2022
1936d73
Apply suggestions from code review
mathbunnyru May 18, 2022
14ee8ff
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru May 19, 2022
7dd4a5f
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru May 19, 2022
3081997
Unify yaml quotes style
mathbunnyru May 19, 2022
0602872
Update codestyle
mathbunnyru May 19, 2022
4e91cc9
Test in the same step as build
mathbunnyru May 19, 2022
4ce4d0c
Add docs
mathbunnyru May 25, 2022
911b4c1
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru May 31, 2022
9818511
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru Jul 4, 2022
42d30ff
Bump actions/setup-python
mathbunnyru Jul 4, 2022
2b844b3
Try to use aarch64 self-hosted runner
mathbunnyru Jul 4, 2022
459b311
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru Jul 4, 2022
b06c797
Fix style
mathbunnyru Jul 4, 2022
d52b8dd
Add artifacts cleanup
mathbunnyru Jul 4, 2022
515404a
Add downloading aarch64 artifacts
mathbunnyru Jul 4, 2022
a350070
Better wording
mathbunnyru Jul 4, 2022
23f0eb9
Always run cleanup steps
mathbunnyru Jul 4, 2022
aad4f22
Always doesn't respect other conditions
mathbunnyru Jul 4, 2022
ad4670b
Add docs to setup aarch64 runner
mathbunnyru Jul 4, 2022
febc1ff
Add always() where needed
mathbunnyru Jul 4, 2022
56f172e
Fixes
mathbunnyru Jul 4, 2022
ed40afb
Better style
mathbunnyru Jul 4, 2022
c71c79e
Add copying authorized_keys
mathbunnyru Jul 4, 2022
625e60b
Better docs
mathbunnyru Jul 4, 2022
c0d3b81
Better docs
mathbunnyru Jul 4, 2022
1be103d
Better docs
mathbunnyru Jul 4, 2022
cc6fb74
Fix linkcheck-docs error
mathbunnyru Jul 4, 2022
500e1a8
Fix linkcheck-docs error
mathbunnyru Jul 4, 2022
171c6c3
Some fixes for push step
mathbunnyru Jul 4, 2022
2cafcc1
More simple README.md
mathbunnyru Jul 4, 2022
44d3104
Remove export G_SLICE=always-malloc
mathbunnyru Jul 4, 2022
c2d33a0
Merge branch 'master' into asalikhov/new_build_system
mathbunnyru Jul 4, 2022
b40de11
Better docs
mathbunnyru Jul 5, 2022
a1e6393
Use ARM64 tag for self-hosted runners
mathbunnyru Jul 5, 2022
6e53601
Better filenames for manifests and hist lines
mathbunnyru Jul 5, 2022
57f882f
Better docs
mathbunnyru Jul 5, 2022
dd646ad
Add --upgrade to pip requirements to have environment identical to fr…
mathbunnyru Jul 5, 2022
e78c8aa
Better docs
mathbunnyru Jul 5, 2022
04f8bd5
Better docs
mathbunnyru Jul 5, 2022
7c4f3bd
Remove unit_check_file
mathbunnyru Jul 5, 2022
1c2a91e
Better docs
mathbunnyru Jul 5, 2022
85daab3
Update url
mathbunnyru Jul 5, 2022
65e0467
Better docs
mathbunnyru Jul 5, 2022
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
26 changes: 26 additions & 0 deletions .github/actions/create-dev-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build environment
description: Create build environment

inputs:
platform:
description: Platform to be run on
required: true
type: string

runs:
using: composite
steps:
# actions/setup-python doesn't suport Linux aarch64 runners
# See: https://github.com/actions/setup-python/issues/108
# python3 is manually preinstalled in the aarch64 VM self-hosted runner
- name: Set Up Python 🐍
uses: actions/setup-python@v4
with:
python-version: 3.x
if: ${{ inputs.platform == 'amd64' }}

- name: Install Dev Dependencies 📦
run: |
pip install --upgrade pip
pip install --upgrade -r requirements-dev.txt
shell: bash
161 changes: 161 additions & 0 deletions .github/actions/download-manifests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Download manifests
description: Download all manifests and history lines

# Unfortunately, `actions/download-artifact` doesn't support wildcard download
# To make this workflow fast, we manually list all manifests and history lines downloads
# https://github.com/actions/download-artifact/issues/6

inputs:
histLineDir:
description: Directory to store history lines
required: true
type: string
manifestDir:
description: Directory to store manifest files
required: true
type: string

runs:
using: composite
steps:
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: base-notebook-aarch64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: base-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: minimal-notebook-aarch64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: minimal-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: scipy-notebook-aarch64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: scipy-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: r-notebook-aarch64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: r-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: tensorflow-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: datascience-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: pyspark-notebook-aarch64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: pyspark-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: all-spark-notebook-aarch64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: all-spark-notebook-amd64-history_line
path: ${{ inputs.histLineDir }}

- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: base-notebook-aarch64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: base-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: minimal-notebook-aarch64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: minimal-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: scipy-notebook-aarch64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: scipy-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: r-notebook-aarch64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: r-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: tensorflow-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: datascience-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: pyspark-notebook-aarch64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: pyspark-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: all-spark-notebook-aarch64-manifest
path: ${{ inputs.manifestDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: all-spark-notebook-amd64-manifest
path: ${{ inputs.manifestDir }}
35 changes: 35 additions & 0 deletions .github/actions/load-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Load Docker image
description: Download image tar and load it to docker

inputs:
image:
description: Image name
required: true
type: string
platform:
description: Image platform
required: true
type: string

runs:
using: composite
steps:
# Self-hosted runners share a state (whole VM) between runs
- name: Reset docker state 🗑️
run: docker system prune --all --force
shell: bash

- name: Download built image 📥
uses: actions/download-artifact@v3
with:
name: ${{ inputs.image }}-${{ inputs.platform }}
path: /tmp/
- name: Load downloaded image to docker 📥
run: |
docker load --input /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
docker image ls -a
shell: bash
- name: Delete the file 🗑️
run: rm -f /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
shell: bash
if: always()
89 changes: 0 additions & 89 deletions .github/workflows/docker-amd64.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/docker-build-test-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Download parent image, build new one, test it and upload to GitHub artifacts

on:
workflow_call:
inputs:
parentImage:
description: Parent image name
required: true
type: string
image:
description: Image name
required: true
type: string
platform:
description: Image platform
required: true
type: string
runsOn:
description: GitHub Actions Runner image
required: true
type: string

jobs:
build-test-upload:
runs-on: ${{ inputs.runsOn }}
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v3
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
with:
platform: ${{ inputs.platform }}

- name: Load parent built image to Docker 📥
if: ${{ inputs.parentImage != '' }}
uses: ./.github/actions/load-image
with:
image: ${{ inputs.parentImage }}
platform: ${{ inputs.platform }}

- name: Build image 🛠
run: docker build --rm --force-rm --tag jupyter/${{ inputs.image }} ${{ inputs.image }}/
env:
DOCKER_BUILDKIT: 1
# Full logs for CI build
BUILDKIT_PROGRESS: plain
shell: bash

- name: Run tests ✅
run: python3 -m tests.run_tests --short-image-name ${{ inputs.image }}
shell: bash

- name: Save image as a tar for later use 💾
run: docker save jupyter/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
shell: bash
- name: Upload image as artifact 💾
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.image }}-${{ inputs.platform }}
path: /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
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
docker system prune --all --force
shell: bash
if: always()
Loading