Skip to content

Commit 3c3e122

Browse files
authored
fix(ci): remove legacy wheel publishing machinery (#331)
1 parent 821b7a8 commit 3c3e122

4 files changed

Lines changed: 1 addition & 244 deletions

File tree

.github/workflows/release-dev.yml

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ jobs:
9696
timeout-minutes: 120
9797
outputs:
9898
wheel_version: ${{ needs.compute-versions.outputs.python_version }}
99-
s3_prefix: ${{ steps.upload.outputs.s3_prefix }}
10099
container:
101100
image: ghcr.io/nvidia/openshell/ci:latest
102101
credentials:
@@ -109,10 +108,6 @@ jobs:
109108
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110109
SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }}
111110
OPENSHELL_IMAGE_TAG: dev
112-
NAV_PYPI_S3_BUCKET: navigator-pypi-artifacts # TODO: rename bucket to openshell-pypi-artifacts
113-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
114-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
115-
AWS_DEFAULT_REGION: us-west-2
116111
steps:
117112
- uses: actions/checkout@v4
118113
with:
@@ -137,96 +132,13 @@ jobs:
137132
OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" mise run python:build:macos
138133
ls -la target/wheels/*.whl
139134
140-
- name: Upload wheels to S3
141-
id: upload
142-
run: |
143-
set -euo pipefail
144-
WHEEL_VERSION="${{ needs.compute-versions.outputs.python_version }}"
145-
S3_PREFIX="openshell/${WHEEL_VERSION}"
146-
aws s3 cp target/wheels/ "s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/" --recursive --exclude "*" --include "*.whl"
147-
aws s3 ls "s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/"
148-
echo "s3_prefix=${S3_PREFIX}" >> "$GITHUB_OUTPUT"
149-
150135
- name: Upload wheel artifacts
151136
uses: actions/upload-artifact@v4
152137
with:
153138
name: python-wheels
154139
path: target/wheels/*.whl
155140
retention-days: 5
156141

157-
publish-python:
158-
name: Publish Python
159-
needs: [build-python-wheels]
160-
runs-on: [self-hosted, nv]
161-
timeout-minutes: 10
162-
env:
163-
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164-
NAV_PYPI_S3_BUCKET: navigator-pypi-artifacts # TODO: rename bucket to openshell-pypi-artifacts
165-
NAV_PYPI_REPOSITORY_URL: https://urm.nvidia.com/artifactory/api/pypi/nv-shared-pypi-local
166-
NAV_PYPI_USERNAME: ${{ secrets.NAV_PYPI_USERNAME }}
167-
NAV_PYPI_PASSWORD: ${{ secrets.NAV_PYPI_PASSWORD }}
168-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
169-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
170-
AWS_DEFAULT_REGION: us-west-2
171-
steps:
172-
- uses: actions/checkout@v4
173-
with:
174-
fetch-depth: 0
175-
176-
- uses: actions/setup-python@v5
177-
with:
178-
python-version: "3.13"
179-
180-
- name: Install publish dependencies
181-
run: |
182-
set -euo pipefail
183-
python -m pip install --upgrade pip uv
184-
185-
if ! command -v aws >/dev/null 2>&1; then
186-
ARCH="$(uname -m)"
187-
case "$ARCH" in
188-
x86_64|amd64) AWSCLI_ARCH="x86_64" ;;
189-
aarch64|arm64) AWSCLI_ARCH="aarch64" ;;
190-
*)
191-
echo "Unsupported architecture for AWS CLI installer: $ARCH" >&2
192-
exit 1
193-
;;
194-
esac
195-
196-
rm -rf aws awscliv2.zip
197-
curl --fail --silent --show-error --location \
198-
"https://awscli.amazonaws.com/awscli-exe-linux-${AWSCLI_ARCH}.zip" \
199-
--output awscliv2.zip
200-
unzip -q awscliv2.zip
201-
./aws/install --install-dir "$HOME/.local/aws-cli" --bin-dir "$HOME/.local/bin" --update
202-
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
203-
export PATH="$HOME/.local/bin:$PATH"
204-
fi
205-
206-
aws --version
207-
uv --version
208-
209-
- name: List and download versioned wheels from S3
210-
run: |
211-
set -euo pipefail
212-
WHEEL_VERSION="${{ needs.build-python-wheels.outputs.wheel_version }}"
213-
S3_PREFIX="${{ needs.build-python-wheels.outputs.s3_prefix }}"
214-
OBJECT_COUNT=$(aws s3api list-objects-v2 --bucket "$NAV_PYPI_S3_BUCKET" --prefix "${S3_PREFIX}/" --query "length(Contents)" --output text)
215-
if [ "$OBJECT_COUNT" = "None" ] || [ "$OBJECT_COUNT" = "0" ]; then
216-
echo "No wheel artifacts found for ${WHEEL_VERSION} at s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/" >&2
217-
exit 1
218-
fi
219-
aws s3api list-objects-v2 --bucket "$NAV_PYPI_S3_BUCKET" --prefix "${S3_PREFIX}/" --query "Contents[].Key" --output text
220-
mkdir -p target/wheels
221-
aws s3 cp "s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/" target/wheels/ --recursive --exclude "*" --include "*.whl"
222-
ls -la target/wheels/*.whl
223-
224-
- name: Publish wheels to Artifactory
225-
run: |
226-
set -euo pipefail
227-
WHEEL_VERSION="${{ needs.build-python-wheels.outputs.wheel_version }}"
228-
uv run python tasks/scripts/release.py python-publish --version "$WHEEL_VERSION"
229-
230142
# ---------------------------------------------------------------------------
231143
# Build CLI binaries (Linux musl — static, native on each arch)
232144
# ---------------------------------------------------------------------------

.github/workflows/release-tag.yml

Lines changed: 1 addition & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ jobs:
116116
timeout-minutes: 120
117117
outputs:
118118
wheel_version: ${{ needs.compute-versions.outputs.python_version }}
119-
s3_prefix: ${{ steps.upload.outputs.s3_prefix }}
120119
container:
121120
image: ghcr.io/nvidia/openshell/ci:latest
122121
credentials:
@@ -129,10 +128,6 @@ jobs:
129128
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130129
SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }}
131130
OPENSHELL_IMAGE_TAG: ${{ needs.compute-versions.outputs.semver }}
132-
NAV_PYPI_S3_BUCKET: navigator-pypi-artifacts # TODO: rename bucket to openshell-pypi-artifacts
133-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
134-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
135-
AWS_DEFAULT_REGION: us-west-2
136131
steps:
137132
- uses: actions/checkout@v4
138133
with:
@@ -158,97 +153,13 @@ jobs:
158153
OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" mise run python:build:macos
159154
ls -la target/wheels/*.whl
160155
161-
- name: Upload wheels to S3
162-
id: upload
163-
run: |
164-
set -euo pipefail
165-
WHEEL_VERSION="${{ needs.compute-versions.outputs.python_version }}"
166-
S3_PREFIX="openshell/${WHEEL_VERSION}"
167-
aws s3 cp target/wheels/ "s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/" --recursive --exclude "*" --include "*.whl"
168-
aws s3 ls "s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/"
169-
echo "s3_prefix=${S3_PREFIX}" >> "$GITHUB_OUTPUT"
170-
171156
- name: Upload wheel artifacts
172157
uses: actions/upload-artifact@v4
173158
with:
174159
name: python-wheels
175160
path: target/wheels/*.whl
176161
retention-days: 5
177162

178-
publish-python:
179-
name: Publish Python
180-
needs: [build-python-wheels, e2e]
181-
runs-on: [self-hosted, nv]
182-
timeout-minutes: 10
183-
env:
184-
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185-
NAV_PYPI_S3_BUCKET: navigator-pypi-artifacts # TODO: rename bucket to openshell-pypi-artifacts
186-
NAV_PYPI_REPOSITORY_URL: https://urm.nvidia.com/artifactory/api/pypi/nv-shared-pypi-local
187-
NAV_PYPI_USERNAME: ${{ secrets.NAV_PYPI_USERNAME }}
188-
NAV_PYPI_PASSWORD: ${{ secrets.NAV_PYPI_PASSWORD }}
189-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
190-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
191-
AWS_DEFAULT_REGION: us-west-2
192-
steps:
193-
- uses: actions/checkout@v4
194-
with:
195-
ref: ${{ inputs.tag || github.ref }}
196-
fetch-depth: 0
197-
198-
- uses: actions/setup-python@v5
199-
with:
200-
python-version: "3.13"
201-
202-
- name: Install publish dependencies
203-
run: |
204-
set -euo pipefail
205-
python -m pip install --upgrade pip uv
206-
207-
if ! command -v aws >/dev/null 2>&1; then
208-
ARCH="$(uname -m)"
209-
case "$ARCH" in
210-
x86_64|amd64) AWSCLI_ARCH="x86_64" ;;
211-
aarch64|arm64) AWSCLI_ARCH="aarch64" ;;
212-
*)
213-
echo "Unsupported architecture for AWS CLI installer: $ARCH" >&2
214-
exit 1
215-
;;
216-
esac
217-
218-
rm -rf aws awscliv2.zip
219-
curl --fail --silent --show-error --location \
220-
"https://awscli.amazonaws.com/awscli-exe-linux-${AWSCLI_ARCH}.zip" \
221-
--output awscliv2.zip
222-
unzip -q awscliv2.zip
223-
./aws/install --install-dir "$HOME/.local/aws-cli" --bin-dir "$HOME/.local/bin" --update
224-
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
225-
export PATH="$HOME/.local/bin:$PATH"
226-
fi
227-
228-
aws --version
229-
uv --version
230-
231-
- name: List and download versioned wheels from S3
232-
run: |
233-
set -euo pipefail
234-
WHEEL_VERSION="${{ needs.build-python-wheels.outputs.wheel_version }}"
235-
S3_PREFIX="${{ needs.build-python-wheels.outputs.s3_prefix }}"
236-
OBJECT_COUNT=$(aws s3api list-objects-v2 --bucket "$NAV_PYPI_S3_BUCKET" --prefix "${S3_PREFIX}/" --query "length(Contents)" --output text)
237-
if [ "$OBJECT_COUNT" = "None" ] || [ "$OBJECT_COUNT" = "0" ]; then
238-
echo "No wheel artifacts found for ${WHEEL_VERSION} at s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/" >&2
239-
exit 1
240-
fi
241-
aws s3api list-objects-v2 --bucket "$NAV_PYPI_S3_BUCKET" --prefix "${S3_PREFIX}/" --query "Contents[].Key" --output text
242-
mkdir -p target/wheels
243-
aws s3 cp "s3://${NAV_PYPI_S3_BUCKET}/${S3_PREFIX}/" target/wheels/ --recursive --exclude "*" --include "*.whl"
244-
ls -la target/wheels/*.whl
245-
246-
- name: Publish wheels to Artifactory
247-
run: |
248-
set -euo pipefail
249-
WHEEL_VERSION="${{ needs.build-python-wheels.outputs.wheel_version }}"
250-
uv run python tasks/scripts/release.py python-publish --version "$WHEEL_VERSION"
251-
252163
# ---------------------------------------------------------------------------
253164
# Build CLI binaries (Linux musl — static, native on each arch)
254165
# ---------------------------------------------------------------------------
@@ -413,7 +324,7 @@ jobs:
413324
# ---------------------------------------------------------------------------
414325
release:
415326
name: Release
416-
needs: [compute-versions, build-cli-linux, build-cli-macos, build-python-wheels, publish-python, tag-ghcr-release]
327+
needs: [compute-versions, build-cli-linux, build-cli-macos, build-python-wheels, tag-ghcr-release]
417328
runs-on: build-amd64
418329
timeout-minutes: 10
419330
steps:

mise.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ UV_CACHE_DIR = "{{config_root}}/.cache/uv"
3636
RUSTC_WRAPPER = "sccache"
3737
SCCACHE_DIR = "{{config_root}}/.cache/sccache"
3838

39-
# Artifact registries
40-
NAV_PYPI_REPOSITORY_URL = "https://urm.nvidia.com/artifactory/api/pypi/nv-shared-pypi-local"
41-
4239
# Shared build constants (overridable via environment)
4340
DOCKER_BUILDKIT = "1"
4441

tasks/scripts/release.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from __future__ import annotations
77

88
import argparse
9-
import fnmatch
10-
import os
119
import re
1210
import subprocess
1311
from dataclasses import dataclass
@@ -69,53 +67,6 @@ def _compute_versions() -> Versions:
6967
)
7068

7169

72-
def python_publish(
73-
version: str | None = None, wheel_glob: str = "openshell-*.whl"
74-
) -> None:
75-
if version is None:
76-
version = _compute_versions().python
77-
78-
repo_url = os.getenv("NAV_PYPI_REPOSITORY_URL")
79-
username = os.getenv("NAV_PYPI_USERNAME")
80-
password = os.getenv("NAV_PYPI_PASSWORD")
81-
82-
if not repo_url or not username or not password:
83-
raise SystemExit(
84-
"Auth is not set up for publishing to PyPI registry, see CONTRIBUTING.md for details."
85-
)
86-
87-
env = dict(os.environ)
88-
env["UV_PUBLISH_USERNAME"] = username
89-
env["UV_PUBLISH_PASSWORD"] = password
90-
91-
wheels_dir = _repo_root() / "target" / "wheels"
92-
wheels_dir.mkdir(parents=True, exist_ok=True)
93-
94-
wheel_paths = sorted(
95-
p
96-
for p in wheels_dir.glob("*.whl")
97-
if f"-{version}-" in p.name and fnmatch.fnmatch(p.name, wheel_glob)
98-
)
99-
100-
if not wheel_paths:
101-
available = "\n".join(sorted(p.name for p in wheels_dir.glob("*.whl")))
102-
raise SystemExit(
103-
f"No wheels found for version {version} in {wheels_dir}.\n"
104-
f"Available wheels:\n{available or '(none)'}"
105-
)
106-
107-
_run(
108-
[
109-
"uv",
110-
"publish",
111-
"--publish-url",
112-
repo_url,
113-
*[str(path) for path in wheel_paths],
114-
],
115-
env=env,
116-
)
117-
118-
11970
def get_version(format: str) -> None:
12071
versions = _compute_versions()
12172
if format == "python":
@@ -147,18 +98,6 @@ def build_parser() -> argparse.ArgumentParser:
14798
"--docker", action="store_true", help="Print Docker version only."
14899
)
149100

150-
python_publish_parser = sub.add_parser(
151-
"python-publish", help="Publish python wheel."
152-
)
153-
python_publish_parser.add_argument(
154-
"--version", help="Version to publish (defaults to computed version)."
155-
)
156-
python_publish_parser.add_argument(
157-
"--wheel-glob",
158-
default="openshell-*.whl",
159-
help="Filename glob for wheels to publish (defaults to all openshell wheels).",
160-
)
161-
162101
return parser
163102

164103

@@ -175,8 +114,6 @@ def main() -> None:
175114
get_version("docker")
176115
else:
177116
get_version("all")
178-
elif args.command == "python-publish":
179-
python_publish(version=args.version, wheel_glob=args.wheel_glob)
180117

181118

182119
if __name__ == "__main__":

0 commit comments

Comments
 (0)