This repository has been archived by the owner on Dec 29, 2024. It is now read-only.
.github/workflows/cicd.yml #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
DOCKER_BUILDKIT: "1" | |
COMPOSE_DOCKER_CLI_BUILD: "1" | |
BUILDKIT_PROGRESS: "plain" | |
NO_SQUASH: "" | |
NO_SILENT: "1" | |
NONINTERACTIVE: "1" | |
FORCE_ONLINE: "1" | |
NBPARALLEL: "2" | |
RELEASABLE_REPOS: "^corpusops/" | |
RELEASABLE_BRANCHES: "^(refs/heads/)?(master|main|2.0|workflows)$" | |
COPS_URL: "https://github.com/corpusops/corpusops.bootstrap" | |
COPS_ROOT: "${{github.workspace}}/local/corpusops.bootstrap" | |
silent: "$COPS_ROOT/bin/cops_shell_common output_in_error silent_vv" | |
DOCKER_RELEASER: "${{ secrets.DOCKER_HUB_USERNAME }}" | |
DOCKER_PASSWORD: "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | |
jobs: | |
r: | |
runs-on: ubuntu-20.04 | |
env: {IMAGES: "${{matrix.IMAGES}}"} | |
steps: | |
# See: https://github.com/actions/virtual-environments/issues/709 | |
- name: get extra space | |
run: |- | |
set -e; | |
cd /opt/hostedtoolcache | |
sudo rm -rf CodeQL PyPy go | |
cd /usr/local | |
sudo rm -rf graalvm aws-cli share/boost lib/node_modules lib/android share/vcpkg | |
cd /usr/share | |
sudo rm -rf dotnet swift az* rust* gradl* miniconda | |
- name: Set vars | |
run: |- | |
if ( echo "$GITHUB_REF" | egrep -q "${RELEASABLE_BRANCHES}" ) \ | |
&& ( echo "$GITHUB_REPOSITORY" | egrep -q "${RELEASABLE_REPOS}" ) | |
then releasable=true;else releasable=false;fi | |
echo "releasable=$releasable" >> $GITHUB_OUTPUT | |
echo "silent=$(echo $silent)" >> $GITHUB_OUTPUT | |
id: v | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Activate docker experimental | |
run: |- | |
sudo bash -exc "service docker stop;python -c \ | |
\"d='/etc/docker/daemon.json';\ | |
import json;c=json.load(open(d));c['experimental']=True;\ | |
open(d, 'w').write(json.dumps(c))\" | |
systemctl restart docker" | |
- uses: actions/checkout@v3 | |
- name: Cache multiple paths | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache | |
local | |
key: 6-${{ runner.os }}-${{ github.ref }}-${{ github.repository }}-venvstatics | |
- name: setup | |
run: set -e;i=$(whoami);sudo sh -c "chown -Rf $i ."; | |
sudo sh -c 'sed -i -re 's/azure.//' /etc/apt/sources.list && apt-get update -qq' && ./main.sh refresh_corpusops; | |
sudo sh -c 'sed -i -re 's/azure.//' /etc/apt/sources.list && apt-get update -qq && apt-get install -qqy --force-yes parallel' | |
- name: refresh images | |
run: set -e;if (echo $IMAGES|grep -q zleftover);then | |
rm -f */*/*/Dockerfile&&${{steps.v.outputs.silent}} ./refresh_images.sh; | |
fi | |
- name: build & release | |
run: set -e; | |
if [ "x${{steps.v.outputs.releasable}}" = "xtrue" ];then export DO_RELEASE=1;fi; | |
./build.sh $IMAGES | |
# ${{steps.v.outputs.silent}} ./build.sh $IMAGES | |
strategy: | |
max-parallel: 5 | |
fail-fast: false | |
matrix: | |
IMAGES: | |
- "tensorflow/serving/latest tensorflow/serving/latest-gpu" | |
- "tensorflow/serving/latest-devel tensorflow/serving/latest-devel-gpu" | |
- "tensorflow/serving/nightly tensorflow/serving/nightly-gpu" | |
- "tensorflow/serving/nightly-devel tensorflow/serving/nightly-devel-gpu" | |
- "tensorflow/tensorflow/devel tensorflow/tensorflow/devel-gpu tensorflow/tensorflow/devel-gpu-py3 tensorflow/tensorflow/devel-py3" | |
- "tensorflow/tensorflow/latest tensorflow/tensorflow/latest-devel tensorflow/tensorflow/latest-devel-gpu tensorflow/tensorflow/latest-devel-gpu-py3 tensorflow/tensorflow/latest-devel-py3" | |
- "tensorflow/tensorflow/latest-gpu tensorflow/tensorflow/latest-gpu-jupyter tensorflow/tensorflow/latest-gpu-py3 tensorflow/tensorflow/latest-gpu-py3-jupyter" | |
- "tensorflow/tensorflow/latest-jupyter tensorflow/tensorflow/latest-py3 tensorflow/tensorflow/latest-py3-jupyter" | |
- "tensorflow/tensorflow/nightly tensorflow/tensorflow/nightly-devel tensorflow/tensorflow/nightly-devel-gpu tensorflow/tensorflow/nightly-devel-gpu-py3 tensorflow/tensorflow/nightly-devel-py3" | |
- "tensorflow/tensorflow/nightly-gpu tensorflow/tensorflow/nightly-gpu-jupyter tensorflow/tensorflow/nightly-gpu-py3 tensorflow/tensorflow/nightly-py3" | |
#- "corpusops/test/a corpusops/test/b corpusops/test/c" | |
# all images that werent explicitly told to be built would be built in the next batches | |
# we span them onto N jobs | |
- "zleftover:1/1" | |
on: | |
push: | |
workflow_dispatch: | |
schedule: [{cron: '1 0 4,6,8,18,20,22 * *'}] |