diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 5e11b4a3..2f1730a0 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Machine for bumping version - uses: snapchat/gigl/.github/actions/setup-python-tools@main + uses: ./.github/actions/setup-python-tools with: setup_gcloud: "true" install_dev_deps: "true" @@ -61,7 +61,7 @@ jobs: - name: Get current version id: get_version run: | - CURRENT_VERSION=$(python -m scripts.bump_version --get_current_version) + CURRENT_VERSION=$(uv run python -m scripts.bump_version --get_current_version) echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT echo "Current version: $CURRENT_VERSION" @@ -70,7 +70,7 @@ jobs: id: set_vars run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "bump_type=${{ github.event.inputs.bump_type }}" >> $GITHUB_OUTPUT + echo "bump_type=${{ inputs.bump_type }}" >> $GITHUB_OUTPUT else echo "bump_type=nightly" >> $GITHUB_OUTPUT fi @@ -78,7 +78,7 @@ jobs: # Perform the version bump - name: Bump version run: | - python -m scripts.bump_version \ + uv run python -m scripts.bump_version \ --bump_type ${{ steps.set_vars.outputs.bump_type }} \ --project ${{ vars.GCP_PROJECT_ID }} @@ -86,7 +86,7 @@ jobs: - name: Get new version id: get_new_version run: | - NEW_VERSION=$(python -m scripts.bump_version --get_current_version) + NEW_VERSION=$(uv run python -m scripts.bump_version --get_current_version) RELEASE_BRANCH_NAME="release/v${NEW_VERSION}" echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT echo "release_branch_name=$RELEASE_BRANCH_NAME" >> $GITHUB_OUTPUT @@ -118,7 +118,7 @@ jobs: ref: ${{ needs.bump_version.outputs.release_branch_name }} - name: Setup Machine for release - uses: snapchat/gigl/.github/actions/setup-python-tools@main + uses: ./.github/actions/setup-python-tools with: setup_gcloud: "true" install_dev_deps: "false" @@ -139,37 +139,38 @@ jobs: service_account: ${{ secrets.gcp_service_account_email }} project: ${{ vars.GCP_PROJECT_ID }} - release_dev_workbench_image: - needs: bump_version - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - id-token: write - - steps: - - name: Checkout release branch - uses: actions/checkout@v4 - with: - ref: ${{ needs.bump_version.outputs.release_branch_name }} - - - name: Setup Machine for workbench image release - uses: snapchat/gigl/.github/actions/setup-python-tools@main - with: - setup_gcloud: "true" - install_dev_deps: "false" - gcp_project_id: ${{ vars.GCP_PROJECT_ID }} - workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} - gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} - - - name: Release Dev Workbench Image - uses: snapchat/gigl/.github/actions/run-cloud-run-command-on-active-checkout@main - with: - cmd: | - bash ./requirements/install_scala_deps.sh --download-only - make push_dev_workbench_docker_image - service_account: ${{ secrets.gcp_service_account_email }} - project: ${{ vars.GCP_PROJECT_ID }} + # TODO: (svij) Let's deprecate this as no one uses it beyond it being used for the TUT. + # release_dev_workbench_image: + # needs: bump_version + # runs-on: ubuntu-latest + # permissions: + # contents: write + # pull-requests: write + # id-token: write + + # steps: + # - name: Checkout release branch + # uses: actions/checkout@v4 + # with: + # ref: ${{ needs.bump_version.outputs.release_branch_name }} + + # - name: Setup Machine for workbench image release + # uses: ./.github/actions/setup-python-tools + # with: + # setup_gcloud: "true" + # install_dev_deps: "false" + # gcp_project_id: ${{ vars.GCP_PROJECT_ID }} + # workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} + # gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} + + # - name: Release Dev Workbench Image + # uses: snapchat/gigl/.github/actions/run-cloud-run-command-on-active-checkout@main + # with: + # cmd: | + # bash ./requirements/install_scala_deps.sh --download-only + # make push_dev_workbench_docker_image + # service_account: ${{ secrets.gcp_service_account_email }} + # project: ${{ vars.GCP_PROJECT_ID }} # TODO: (svij) Also release the dev image @@ -179,7 +180,7 @@ jobs: needs: - bump_version - release_gigl_kfp_pipeline - - release_dev_workbench_image + # - release_dev_workbench_image runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/nightly_release_&_test.yml b/.github/workflows/nightly_release_&_test.yml index 03146008..98fef40f 100644 --- a/.github/workflows/nightly_release_&_test.yml +++ b/.github/workflows/nightly_release_&_test.yml @@ -14,7 +14,7 @@ permissions: # Calls create_release w/ nightly and then run the api tests jobs: create-release: - uses: snapchat/gigl/.github/workflows/create_release.yml@main + uses: ./.github/workflows/create_release.yml secrets: inherit with: bump_type: nightly @@ -28,14 +28,14 @@ jobs: with: ref: ${{ needs.create-release.outputs.release_branch_name }} - name: Setup development environment - uses: snapchat/gigl/.github/actions/setup-python-tools@main + uses: ./.github/actions/setup-python-tools with: setup_gcloud: "true" gcp_project_id: ${{ vars.GCP_PROJECT_ID }} workload_identity_provider: ${{ secrets.workload_identity_provider }} gcp_service_account_email: ${{ secrets.gcp_service_account_email }} - name: Run API Tests - uses: snapchat/gigl/.github/actions/run-cloud-run-command-on-active-checkout@main + uses: ./.github/actions/run-cloud-run-command-on-active-checkout with: cmd: "make run_api_test" service_account: ${{ secrets.gcp_service_account_email }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d6c240e..777e6818 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python deps and gcloud - uses: snapchat/gigl/.github/actions/setup-python-tools@main + uses: ./.github/actions/setup-python-tools with: install_dev_deps: "true" setup_gcloud: "true" @@ -37,10 +37,11 @@ jobs: # And: https://cloud.google.com/artifact-registry/docs/python/authentication - name: Setup environment for publishing Python package run: | - python -m pip install --upgrade build==1.3.0 twine==6.2.0 keyrings.google-artifactregistry-auth==1.1.2 + # Pre-install keyring and Artifact Registry plugin from the public PyPI + uv tool install keyring --with keyrings.google-artifactregistry-auth==1.1.2 - name: Build Whl Distribution - run: (cd python && python -m build) + run: uv build - name: Publish Package 🚀 env: @@ -48,13 +49,7 @@ jobs: PIP_CONF_CONTENTS: ${{ secrets.PIP_CONF_CONTENTS }} # We upload the build whls to Google Artifact Registry. run: | - echo "$PYPIRC_CONTENTS" > ~/.pypirc - mkdir -p ~/.pip - echo "$PIP_CONF_CONTENTS" > ~/.pip/pip.conf - gcloud config set artifacts/location us-central1 - gcloud config set artifacts/repository gigl - python -m twine check python/dist/* - python -m twine upload --repository-url https://us-central1-python.pkg.dev/${PROJECT_ID}/gigl python/dist/* + uv publish --index gcp-release-registry --username oauth2accesstoken --keyring-provider subprocess - name: Post Publish Package if: always() diff --git a/docs/user_guide/getting_started/installation.md b/docs/user_guide/getting_started/installation.md index 1082d274..0b4fc8b4 100644 --- a/docs/user_guide/getting_started/installation.md +++ b/docs/user_guide/getting_started/installation.md @@ -94,21 +94,17 @@ Below we provide two ways to bootstrap an environment for using and/or developin ### Install Wheel -1. Create a python environment - -```bash -conda create -y --override-channels --channel conda-forge --name gigl python=3.9 -conda activate gigl -``` +1. Create a python virtual environment w/ `python==3.11.*` 2. Install GiGL -#### Install GiGL + necessary tooling for Torch 2.5 + Cuda12.1 +#### Install GiGL + necessary tooling for PyG 2.7 + Torch 2.8 on Cuda12.8 ```bash -pip install "gigl[torch25-cuda-121,transform]==0.0.9" \ - --index-url=https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl/simple/ \ - --extra-index-url=https://pypi.org/simple +pip install "gigl[pyg27-torch28-cu128, transform]==0.1.0" \ +--extra-index-url=https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl/simple/ \ +--extra-index-url=https://download.pytorch.org/whl/cu128 \ +--extra-index-url=https://data.pyg.org/whl/torch-2.8.0+cu128.html ``` Currently, building/using wheels for GLT is error prone, thus we opt to install from source every time. Run post-install @@ -118,12 +114,13 @@ script to setup GLT dependency: gigl-post-install ``` -#### Install GiGL + necessary tooling for Torch 2.5 + CPU +#### Install GiGL + necessary tooling for PyG 2.7 + Torch 2.8 on CPU ```bash -pip install "gigl[torch25-cpu,transform]==0.0.9" \ - --index-url=https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl/simple/ \ - --extra-index-url=https://pypi.org/simple +pip install "gigl[pyg27-torch28-cpu, transform]==0.1.0" \ +--extra-index-url=https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl/simple/ \ +--extra-index-url=https://download.pytorch.org/whl/cpu \ +--extra-index-url=https://data.pyg.org/whl/torch-2.8.0+cpu.html ``` Currently, building/using wheels for GLT is error prone, thus we opt to install from source every time. Run post-install @@ -135,20 +132,18 @@ gigl-post-install ### Install from source -There are various ways to use GiGL. Firstly, clone the repo locally. - ```bash git clone https://github.com/Snapchat/GiGL.git ``` -From the root directory: +If you are just using (not developing) GiGL, from the root directory: ```bash make install_deps ``` If you *instead* want to contribute and/or extend GiGL. You can install the developer deps which includes some extra -tooling useful for contributions: +tooling: ```bash make install_dev_deps diff --git a/docs/user_guide/trouble_shooting/adding_new_package.md b/docs/user_guide/trouble_shooting/adding_new_package.md index 413a861a..b891494b 100644 --- a/docs/user_guide/trouble_shooting/adding_new_package.md +++ b/docs/user_guide/trouble_shooting/adding_new_package.md @@ -6,8 +6,10 @@ This document outlines the steps required to add a new Python package as a depen Open `pyproject.toml` file --> Add the package to its correct location (dev, transform, etc.). Guidance: -1. Freeze (set explicit versions e.g. `my-lib==1.2.3`) versions of doc deps as version updates changes how the doc pages are rendered, files are formatted, etc. -2. Freeze versions for deps that don't do a great job of maintaining in their wheels what libs / libraries they are compatible with - this is a problem with packages like tensorflow. +1. Freeze (set explicit versions e.g. `my-lib==1.2.3`) versions of doc deps as version updates changes how the doc pages + are rendered, files are formatted, etc. +2. Freeze versions for deps that don't do a great job of maintaining in their wheels what libs / libraries they are + compatible with - this is a problem with packages like tensorflow. 3. Everything else, let it auto resolve so we can keep flexibility for GiGL lib users. ### 2. Hash Generation diff --git a/pyproject.toml b/pyproject.toml index 75b8a833..c46ca729 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -175,6 +175,13 @@ url = "https://data.pyg.org/whl/torch-2.8.0+cu128.html" explicit = true format = "flat" +# =============================== Google Artifact Registry Index ======================== +[[tool.uv.index]] +name = "gcp-release-registry" +url = "https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl/simple/" +publish-url = "https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl" +explicit = true + # ========== Mapping individual packages to their appropriate index ============= [tool.uv.sources] # ============= PyTorch hosted Package Index Mappings diff --git a/python/gigl/__init__.py b/python/gigl/__init__.py index b2f01558..3dc1f76b 100644 --- a/python/gigl/__init__.py +++ b/python/gigl/__init__.py @@ -1 +1 @@ -__version__ = "0.0.11" +__version__ = "0.1.0"