Skip to content

Commit e6c546b

Browse files
authored
Merge pull request #2 from Bobbins228/test-sync-workflow
Test sync workflow
2 parents 415b055 + a1d95fc commit e6c546b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8947
-12722
lines changed

.github/build/Containerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ LABEL summary="Toolchain for running pre-commit hooks." \
55
io.k8s.display-name="Pre-Commit Toolchain"
66

77
USER root
8-
RUN dnf install nodejs
8+
RUN dnf install nodejs -y && \
9+
dnf clean all && \
10+
rm -rf /var/cache/dnf
11+
ADD https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz $TMPDIR/
12+
RUN tar -C /usr/local/bin -xvf $TMPDIR/oc.tar.gz && \
13+
chmod +x /usr/local/bin/oc && \
14+
rm $TMPDIR/oc.tar.gz
915
USER $USERID
1016

11-
COPY requirements-dev.txt /tmp/requirements-dev.txt
12-
RUN python -m pip install -r /tmp/requirements-dev.txt
17+
RUN pip3 install poetry && \
18+
poetry config virtualenvs.create false
19+
COPY pyproject.toml ./
20+
RUN poetry install
1321

1422
CMD bash

.github/build/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Pre-Commit Build Artifacts
22

3-
This directory contains the artifacts required to build the codeflare-sdk pre-commit image. As of right now, we will need to manually update `requirements-dev.txt` in this directory as well.
3+
This directory contains the artifacts required to build the codeflare-sdk pre-commit image.
4+
5+
To build the image run `podman build -f .github/build/Containerfile .` from the root directory.

.github/build/requirements-dev.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Label new issues as needs-triage and add to CodeFlare Sprint Board
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
jobs:
7+
add_label:
8+
name: Add needs-triage label to new issues
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- uses: actions/checkout@v3
14+
- run: gh issue edit ${{ github.event.issue.number }} --add-label "triage/needs-triage"
15+
env:
16+
GH_TOKEN: ${{ github.token }}
17+
18+
add-to-project:
19+
name: Add issue to project
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/[email protected]
23+
with:
24+
project-url: https://github.com/orgs/project-codeflare/projects/8
25+
github-token: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}

.github/workflows/coverage-badge.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install pytest==6.2.4
24-
pip install pytest-mock==3.6.1
25-
pip install coverage
26-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
23+
pip install poetry
24+
poetry config virtualenvs.create false
25+
poetry lock --no-update
26+
poetry install --with test
2727
- name: Generate coverage report
2828
run: |
2929
coverage run -m --source=src pytest -v tests/unit_test.py

.github/workflows/fork-sync.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This workflow will build the CodeFlare Operator image and push it to the opendatahub image registry as well as update versions in the MakeFile and README
2+
3+
name: Fork Sync
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: tgymnich/[email protected]
15+
with:
16+
token: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
17+
base: main
18+
head: main
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Notebook Image Build and Push
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-version:
7+
type: string
8+
required: true
9+
description: 'Version number (for example: 0.1.0)'
10+
is-stable:
11+
description: 'Select if the built image should be tagged as stable'
12+
required: true
13+
type: boolean
14+
quay-organization:
15+
description: 'Quay organization used to push the built images to'
16+
required: true
17+
default: 'project-codeflare'
18+
python_version:
19+
type: string
20+
default: "3.8"
21+
required: true
22+
poetry_version:
23+
type: string
24+
default: "1.5.1"
25+
required: true
26+
27+
jobs:
28+
release:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Cleanup
32+
run: |
33+
ls -lart
34+
echo "Initial status:"
35+
df -h
36+
echo "Cleaning up resources:"
37+
sudo swapoff -a
38+
sudo rm -f /swapfile
39+
sudo apt clean
40+
sudo rm -rf /usr/share/dotnet
41+
sudo rm -rf /opt/ghc
42+
sudo rm -rf "/usr/local/share/boost"
43+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
44+
docker rmi $(docker image ls -aq)
45+
echo "Final status:"
46+
df -h
47+
- name: Checkout the repository
48+
uses: actions/checkout@v3
49+
- name: Install Python
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ github.event.inputs.python_version }}
53+
- name: Image Build
54+
run: |
55+
cd custom-nb-image
56+
podman build --build-arg SDK_VERSION="${{ github.event.inputs.release-version }}" -t quay.io/${{ github.event.inputs.quay-organization }}/notebook:v${{ github.event.inputs.release-version }} .
57+
- name: Login to Quay.io
58+
uses: redhat-actions/podman-login@v1
59+
with:
60+
registry: quay.io
61+
username: ${{ secrets.QUAY_ID }}
62+
password: ${{ secrets.QUAY_TOKEN }}
63+
- name: Image Push
64+
run: podman push quay.io/${{ github.event.inputs.quay-organization }}/notebook:v${{ github.event.inputs.release-version }}
65+
- name: Image Push Stable
66+
if: ${{ inputs.is-stable }}
67+
run: podman push quay.io/${{ github.event.inputs.quay-organization }}/notebook:v${{ github.event.inputs.release-version }} quay.io/${{ github.event.inputs.quay-organization }}/notebook:stable
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Nightly Image Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
PYTHON_VERSION: 3.8
11+
POETRY_VERSION: 1.5.1
12+
QUAY_ORGANIZATION: 'project-codeflare'
13+
SDK_FILE: 'codeflare_sdk-0.0.0.dev0.tar.gz'
14+
IMAGE_TAG: 'dev'
15+
16+
jobs:
17+
nightly-build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout the repository
21+
uses: actions/checkout@v3
22+
- name: Install Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ env.PYTHON_VERSION }}
26+
- name: Install Poetry
27+
uses: abatilo/actions-poetry@v2
28+
with:
29+
poetry-version: ${{ env.POETRY_VERSION }}
30+
- name: Run poetry install
31+
run: poetry install --with docs
32+
- name: Run poetry build
33+
run: poetry build
34+
- name: Copy SDK package
35+
run: cp dist/${SDK_FILE} custom-nb-image
36+
- name: Modify Dockerfile to use locally built SDK
37+
run: |
38+
sed -i "s/ARG SDK_VERSION=.*/COPY ${{ env.SDK_FILE }} ./" custom-nb-image/Dockerfile
39+
sed -i "s/codeflare-sdk==.*/${{ env.SDK_FILE }}\\\\/" custom-nb-image/Dockerfile
40+
- name: Image Build
41+
working-directory: custom-nb-image
42+
run: docker build -t quay.io/${{ env.QUAY_ORGANIZATION }}/notebook:${{ env.IMAGE_TAG }} .
43+
- name: Login to Quay.io
44+
uses: docker/login-action@v2
45+
with:
46+
registry: quay.io
47+
username: ${{ secrets.QUAY_ID }}
48+
password: ${{ secrets.QUAY_TOKEN }}
49+
- name: Image Push
50+
run: docker push quay.io/${{ env.QUAY_ORGANIZATION }}/notebook:${{ env.IMAGE_TAG }}
File renamed without changes.

.github/workflows/python-app.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)