Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflow_scripts/setup_conda_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Ensure the script fails on error
set -e

# Variables (Consider passing these as arguments to the script instead of hardcoding)
CONDA_ENV_NAME=gnn
PYTHON_VERSION=3.8

echo "Initializing environment and installing dependencies"

if [ ! -d "$HOME/miniconda" ]; then
echo "Miniconda not found, installing..."
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/miniconda.sh
bash $HOME/miniconda.sh -b -p $HOME/miniconda
else
echo "Miniconda already installed"
fi

# Initialize conda in script
source $HOME/miniconda/etc/profile.d/conda.sh
conda init bash

# Create the conda environment
conda create -y -c conda-forge --name ${CONDA_ENV_NAME} python=${PYTHON_VERSION} pip-tools

# Reactivate conda.sh to ensure the conda activate command works
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate ${CONDA_ENV_NAME}

echo "${CONDA_ENV_NAME} environment is ready and activated."
38 changes: 38 additions & 0 deletions .github/workflows/build-base-docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build-base-docker-images

on:
issue_comment:
types: [created]

jobs:
build-docker-images:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
env:
TAG: ${{ github.run_number}}
if: contains(github.event.comment.body, '/build_base_docker_images')
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Google Cloud Auth
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}

- name: Set Up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}

- name: Build and Push Docker Images
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/gigl-base-images/gigl-cpu-base:${TAG} -f containers/Dockerfile.cpu.base .
docker push us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/gigl-base-images/gigl-cpu-base:${TAG}
docker build -t us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/gigl-base-images/gigl-cuda-base:${TAG} -f containers/Dockerfile.cuda.base .
docker push us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/gigl-base-images/gigl-cuda-base:${TAG}
58 changes: 58 additions & 0 deletions .github/workflows/generate-hashed-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: generate-hashed-requirements

on:
issue_comment:
types: [created]

jobs:
generate-linux-hashed-requirements:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/generate_hashed_requirements')
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9.18'

- name: Install pip-tools
run: pip install pip-tools

- name: Generate hashed requirements
run: |
pip-compile -v --allow-unsafe --generate-hashes --no-emit-index-url --resolver=backtracking \
--output-file=requirements/dev_linux_cuda_requirements_unified.txt \
./pyproject.toml

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dev_linux_cuda_requirements_unified
path: requirements/dev_linux_cuda_requirements_unified.txt

generate-mac-hashed-requirements:
runs-on: macos-14
if: contains(github.event.comment.body, '/generate_hashed_requirements')
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9.18'

- name: Install pip-tools
run: pip install pip-tools

- name: Generate hashed requirements
run: |
pip-compile -v --allow-unsafe --generate-hashes --no-emit-index-url --resolver=backtracking \
--output-file=requirements/dev_darwin_arm64_requirements_unified.txt \
./pyproject.toml

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dev_darwin_arm64_requirements_unified
path: requirements/dev_darwin_arm64_requirements_unified.txt
77 changes: 77 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: integration_tests

on:
issue_comment:
types: [created]

jobs:
integration_tests:
permissions:
contents: 'read'
id-token: 'write'
pull-requests: write
statuses: write
if: contains(github.event.comment.body, '/integration_tests')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Conda Environment
run: |
./.github/workflow_scripts/setup_conda_environment.sh
shell: bash

- name: Install Dependencies
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate gnn
make install_dev_deps
shell: bash

- name: Google Cloud Auth
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}

- name: Use gcloud CLI
run: gcloud info

- name: Run Integration Tests
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate gnn
make integration_test
make integration_e2e_test
shell: bash

- name: Fetch PR details and update commit status
uses: actions/github-script@v5
if: always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pullRequest = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});

const state = '${{ job.status }}';

github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: pullRequest.data.head.sha,
state: state,
description: 'The integration tests have completed',
context: 'integration-tests'
})

51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user

- name: Build Binary Distribution
run: python3 -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish:
name: Publish to TestPyPi 🚀
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build
environment: release
permissions:
id-token: write
steps:
- name: Download distribution
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
32 changes: 32 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: unit_test

on:
pull_request:
types: [synchronize, opened, reopened]

jobs:
unit-tests:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Conda Environment
run: |
./.github/workflow_scripts/setup_conda_environment.sh
shell: bash

- name: Install Dependencies
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate gnn
make install_dev_deps
shell: bash

- name: Run Unit Tests
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate gnn
make unit_test
shell: bash