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

Create CI system for ChAI #28

Merged
merged 29 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f4e42fd
Add gh ci for vgg frog.
Iainmon Jan 28, 2025
e347bae
Fix CI workflow.
Iainmon Jan 28, 2025
a905d59
Change CI action hook.
Iainmon Jan 28, 2025
2463ace
Remove frog inference necessity.
Iainmon Jan 28, 2025
3f304f2
Change CI action hook condition.
Iainmon Jan 28, 2025
b9083cf
Add python requirement check to CI.
Iainmon Jan 28, 2025
2e8f993
Add experimental changes to CI action. Going to see what happens.
Iainmon Jan 28, 2025
3f09fb5
Fix cases.
Iainmon Jan 28, 2025
456df1e
Fix cases in username.
Iainmon Jan 28, 2025
c752cd5
Change nominal CI file to use trivial dependency install.
Iainmon Jan 28, 2025
4f78710
Add many additions to CI testing. Please take a look.
Iainmon Jan 28, 2025
c61d80e
Modify CI shell pipeline syntax.
Iainmon Jan 28, 2025
452f737
Modify CI shell pipeline syntax with &&.
Iainmon Jan 28, 2025
4d5c7c8
Add torchvision to dependencies in CI.
Iainmon Jan 28, 2025
e4f5b66
Add pip venv changes.
Iainmon Jan 28, 2025
a45e149
Remove pip venv changes.
Iainmon Jan 28, 2025
f201c59
Change Python3.12 install procedure.
Iainmon Jan 28, 2025
8a42a7b
Change apt to pip3.
Iainmon Jan 28, 2025
eb26259
Make apt flags into pip3 flags.
Iainmon Jan 28, 2025
bd3b490
Test CI Python PIP configuration :).
Iainmon Jan 28, 2025
858a8b9
Increase Python version.
Iainmon Jan 28, 2025
71dcf14
Change apt to apt-get.
Iainmon Jan 28, 2025
4a084f7
Add -y to apt-get and apt commands
Iainmon Jan 28, 2025
2205587
Add different repos for apt.
Iainmon Jan 28, 2025
cad612e
Micro change.
Iainmon Jan 28, 2025
e4d2f37
Micro change.
Iainmon Jan 28, 2025
98f4654
Micro change.
Iainmon Jan 28, 2025
fe484c2
Micro change.
Iainmon Jan 28, 2025
152b955
Small change to CI.
Iainmon Jan 28, 2025
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
54 changes: 54 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
chapel-run-function:
runs-on: ubuntu-latest
container:
image: chapel/chapel:latest
# env:
# ports:
# - 80
# volumes:
# - my_docker_volume:/volume_mount
# options: --cpus 1
steps:
- name: Install Python, pip, and Python libraries
run: |
# # add-apt-repository ppa:qameta/allure
# add-apt-repository ppa:deadsnakes/ppa
# apt-get install -y software-properties-common
# apt-get update -y
apt-get install -y python3
# python3 --version
# python3 -m venv .venv
# source .venv/bin/activate
# which python
python3 -m pip install --upgrade pip
python3 -m pip --version

# pip3 install --no-cache-dir python3-pip
pip3 install --no-cache-dir numpy
pip3 install --no-cache-dir torch
pip3 install --no-cache-dir torchvision
# pip3 install --no-cache-dir virtualenv
- uses: actions/checkout@v4
- name: Check for dockerenv file and Python version
run: |
ls /.dockerenv && echo Found dockerenv
echo "No dockerenv"
python3 --version || echo "Python not found!"
- name: Compile example/vgg
run: |
(cd examples/vgg && chpl test.chpl -M ../../src -M ../../lib -o vgg && python3 dump_weights.py && python3 process_img.py imgs/frog.jpg && ./vgg imgs/frog.chdata)
- name: Run correspondence tests
run: |
(cd test/correspondence && python3 correspondence.py) || echo "Wups! Correspondence bug or more likely test failure!"
- name:
run: |
echo "Pau!"
55 changes: 55 additions & 0 deletions .github/workflows/build-CI-container.yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build-CI-container

env:
REGISTRY: ghcr.io
# NOTE: IMAGE_NAME must be lowercase
IMAGE_NAME: chai-github-ci
# NOTE: if this filename changes, also update in the on.paths section below
DOCKERFILE: .github/docker/Dockerfile

on:
push:
branches: [ main ]
# This limits the action so it only builds when this file changes
paths:
# unfortunately we can't use ${{env.DOCKERFILE}} here
# see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
- .github/docker/Dockerfile
# also trigger on changes to this workflow file itself
- .github/workflows/build-CI-container.yml
pull_request:
paths:
# same as for pushes above
- .github/docker/Dockerfile
- .github/workflows/build-CI-container.yml
# Adds a "manual run" option in the GH UI
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
uses: docker/[email protected]
with:
file: ${{ env.DOCKERFILE }}
# example: ghcr.io/chapel-lang/chapel-github-ci:latest
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
- name: Push Docker Image if on main
uses: docker/[email protected]
with:
file: ${{ env.DOCKERFILE }}
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
34 changes: 34 additions & 0 deletions .github/workflows/build-and-push-to-docker.yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Push Docker

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./docker # Folder containing your Dockerfile
file: ./docker/Dockerfile
push: true
tags: ghcr.io/iainmon/chai/chai-github-ci:latest
31 changes: 31 additions & 0 deletions .github/workflows/ref-docker.yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
chapel-run-function:
runs-on: ubuntu-latest
container:
# If using Docker Hub:
# image: my-docker-user/my-chapel-python:latest
# Or if using GHCR:
image: ghcr.io/iainmon/chai/chai-github-ci:latest
steps:
- uses: actions/checkout@v4

- name: Check Python and Torch
run: |
python3 --version
python3 -c "import torch; print('Torch version:', torch.__version__)"

- name: Compile example/vgg
run: |
cd examples/vgg
chpl test.chpl -M ../../src -M ../../lib -o vgg

- name: Final step
run: echo "Pau!"
Binary file added examples/vgg/imgs/frog.chdata
Binary file not shown.