Skip to content

Commit

Permalink
Build pipeline - automate ci/release/publish process and periodic ima…
Browse files Browse the repository at this point in the history
…ges rebuild
  • Loading branch information
idirze committed May 14, 2024
1 parent 3780fc5 commit ce537f7
Show file tree
Hide file tree
Showing 47 changed files with 794 additions and 529 deletions.
4 changes: 2 additions & 2 deletions .build/.versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ compatibility-matrix:
# https://spark.apache.org/releases/spark-release-3-5-0.html
# Minimum supported java version: 17/21
- python_version: 3.11
spark_version: [3.5.0]
spark_version: [3.5.1]
java_version: [17]
scala_version: [2.12, 2.13]
hadoop_version: 3
Expand All @@ -41,7 +41,7 @@ compatibility-matrix:
### 3- The versions not present on compatibility-matrix are ignored
build-matrix:
python_version: ['3.9', '3.10', '3.11']
spark_version: [3.2.4, 3.3.2, 3.3.4, 3.4.2, 3.5.0]
spark_version: [3.2.4, 3.3.2, 3.3.4, 3.4.2, 3.5.1]
java_version: [11, 17]
scala_version: [2.12]

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def generate_tags(self) -> [str]:
"--registry",
required=True,
type=str,
choices=["ghcr.io"],
choices=["quay.io", "ghcr.io"],
help="Image registry",
)
arg_parser.add_argument(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions .github/actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright 2024 tosit.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Free disk space
description: Free Github runnner disk space

runs:
using: composite
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true



8 changes: 4 additions & 4 deletions .github/actions/install-patchs-and-extension/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ runs:
steps:
- name: Setup dev env requirement 📦
run: |
cp -f requirements-dev.txt ../
cat ../python/requirements-extended.txt >> ../requirements-dev.txt
cp -f requirements-dev.txt ../requirements-dev.txt
cat ../.build/python/requirements-dev.txt >> ../requirements-dev.txt
working-directory: ./docker-stacks
shell: bash

- name: Copy patchs 📦
run: |
cp -fr ../python/okdp/patch/* ./
cp -fr ../python/okdp ./
cp -fr ../.build/python/okdp/patch/* ./
cp -fr ../.build/python/okdp ./
working-directory: ./docker-stacks
shell: bash

29 changes: 29 additions & 0 deletions .github/actions/setup-buildx/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright 2024 tosit.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Set up QEMU and Docker Buildx
description: Set up Docker Buildx

runs:
using: composite
steps:
- name: Set up QEMU 📦
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx 📦
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
3 changes: 1 addition & 2 deletions .github/workflows/auto-rerun.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Credit for the following workraound: https://github.com/orgs/community/discussions/67654#discussioncomment-8038649
# https://github.com/orgs/community/discussions/67654#discussioncomment-8038649
name: Automatic partital rerun on workflow failure
on:
workflow_dispatch:
Expand All @@ -23,5 +23,4 @@ jobs:
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, test, and push jupyter base images
name: Jupyter base build images template

on:
workflow_call:
Expand All @@ -11,72 +11,73 @@ on:
description: Tag to use for latest base images (foundation, minimal, etc)
required: true
type: string
publish_to_registry:
description: Wheter to push to the registry
required: false
type: string
default: "false"
registry:
description: The list of tags space separated values
required: true
required: false
type: string
git_latest_release_tag:
description: The latest remote release tag
required: false
type: string
default: ""
runs-on:
description: GitHub Actions Runner image
required: true
type: string
secrets:
registry_username:
required: true
registry_token:
required: true

defaults:
run:
working-directory: ./docker-stacks

jobs:

docker-stacks-foundation:
uses: ./.github/workflows/docker-build-test-push-latest.yml
uses: ./.github/workflows/build-image-template.yml
with:
parent-image: ""
image: docker-stacks-foundation:${{ inputs.python_dev_tag }}
registry: ${{ inputs.registry }}
build-args:
PYTHON_VERSION=${{ inputs.python_version }}
registry: ${{ inputs.registry }}
publish_to_registry: ${{ inputs.publish_to_registry }}
git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
runs-on: ubuntu-latest
secrets:
registry_username: ${{ secrets.registry_username }}
registry_token: ${{ secrets.registry_token }}
secrets: inherit

base-notebook:
uses: ./.github/workflows/docker-build-test-push-latest.yml
uses: ./.github/workflows/build-image-template.yml
with:
parent-image: docker-stacks-foundation:${{ inputs.python_dev_tag }}
image: base-notebook:${{ inputs.python_dev_tag }}
registry: ${{ inputs.registry }}
publish_to_registry: ${{ inputs.publish_to_registry }}
git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
runs-on: ubuntu-latest
secrets:
registry_username: ${{ secrets.registry_username }}
registry_token: ${{ secrets.registry_token }}
secrets: inherit
needs: [docker-stacks-foundation]

minimal-notebook:
uses: ./.github/workflows/docker-build-test-push-latest.yml
uses: ./.github/workflows/build-image-template.yml
with:
parent-image: base-notebook:${{ inputs.python_dev_tag }}
image: minimal-notebook:${{ inputs.python_dev_tag }}
registry: ${{ inputs.registry }}
publish_to_registry: ${{ inputs.publish_to_registry }}
git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
runs-on: ubuntu-latest
secrets:
registry_username: ${{ secrets.registry_username }}
registry_token: ${{ secrets.registry_token }}
secrets: inherit
needs: [base-notebook]

scipy-notebook:
uses: ./.github/workflows/docker-build-test-push-latest.yml
uses: ./.github/workflows/build-image-template.yml
with:
parent-image: minimal-notebook:${{ inputs.python_dev_tag }}
image: scipy-notebook:${{ inputs.python_dev_tag }}
registry: ${{ inputs.registry }}
publish_to_registry: ${{ inputs.publish_to_registry }}
git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
runs-on: ubuntu-latest
secrets:
registry_username: ${{ secrets.registry_username }}
registry_token: ${{ secrets.registry_token }}
secrets: inherit
needs: [minimal-notebook]

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, test, and push jupyter datascience images
name: Jupyter datascience build images template

on:
workflow_call:
Expand All @@ -7,79 +7,80 @@ on:
description: Tag to use for latest base images (foundation, minimal, etc)
required: true
type: string
publish_to_registry:
description: Wheter to push to the registry
required: false
type: string
default: "false"
registry:
description: The list of tags space separated values
required: true
required: false
type: string
git_latest_release_tag:
description: The latest remote release tag
required: false
type: string
default: ""
runs-on:
description: GitHub Actions Runner image
required: true
type: string
secrets:
registry_username:
required: true
registry_token:
required: true

defaults:
run:
working-directory: ./docker-stacks

jobs:
r:
uses: ./.github/workflows/docker-build-test-push-latest.yml
uses: ./.github/workflows/build-image-template.yml
with:
parent-image: minimal-notebook:${{ inputs.python_dev_tag }}
image: r-notebook:${{ inputs.python_dev_tag }}
registry: ${{ inputs.registry }}
publish_to_registry: ${{ inputs.publish_to_registry }}
git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
runs-on: ${{ inputs.runs-on }}
secrets:
registry_username: ${{ secrets.registry_username }}
registry_token: ${{ secrets.registry_token }}
secrets: inherit

datascience:
uses: ./.github/workflows/docker-build-test-push-latest.yml
uses: ./.github/workflows/build-image-template.yml
with:
parent-image: scipy-notebook:${{ inputs.python_dev_tag }}
image: datascience-notebook:${{ inputs.python_dev_tag }}
registry: ${{ inputs.registry }}
publish_to_registry: ${{ inputs.publish_to_registry }}
git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
runs-on: ${{ inputs.runs-on }}
secrets:
registry_username: ${{ secrets.registry_username }}
registry_token: ${{ secrets.registry_token }}
secrets: inherit

# julia:
# uses: ./.github/workflows/docker-build-test-push-latest.yml
# uses: ./.github/workflows/build-image-template.yml
# with:
# parent-image: minimal-notebook:${{ inputs.python_dev_tag }}
# image: julia-notebook
# registry: ${{ inputs.registry }}
# publish_to_registry: ${{ inputs.publish_to_registry }}
# git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
# runs-on: ${{ inputs.runs-on }}
# secrets:
# registry_username: ${{ secrets.registry_username }}
# registry_token: ${{ secrets.registry_token }}
# secrets: inherit

# tensorflow:
# uses: ./.github/workflows/docker-build-test-push-latest.yml
# uses: ./.github/workflows/build-image-template.yml
# with:
# parent-image: scipy-notebook:${{ inputs.python_dev_tag }}
# image: tensorflow-notebook
# registry: ${{ inputs.registry }}
# publish_to_registry: ${{ inputs.publish_to_registry }}
# git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
# runs-on: ${{ inputs.runs-on }}
# secrets:
# registry_username: ${{ secrets.registry_username }}
# registry_token: ${{ secrets.registry_token }}
# secrets: inherit

# pytorch:
# uses: ./.github/workflows/docker-build-test-push-latest.yml
# uses: ./.github/workflows/build-image-template.yml
# with:
# parent-image: scipy-notebook:${{ inputs.python_dev_tag }}
# image: pytorch-notebook
# registry: ${{ inputs.registry }}
# publish_to_registry: ${{ inputs.publish_to_registry }}
# git_latest_release_tag: ${{ inputs.git_latest_release_tag }}
# runs-on: ${{ inputs.runs-on }}
# secrets:
# registry_username: ${{ secrets.registry_username }}
# registry_token: ${{ secrets.registry_token }}
# secrets: inherit



Expand Down
Loading

0 comments on commit ce537f7

Please sign in to comment.