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

[no-relnote] Add instructions to produce a once-off build #757

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
103 changes: 103 additions & 0 deletions scripts/hotfix-patch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Patching a release

```
source ./scripts/utils.sh

export REFERENCE=main
```

```
SHA=$(git rev-parse --short=8 ${REFERENCE})
IMAGE_NAME="ghcr.io/nvidia/container-toolkit"
IMAGE_TAG=${SHA}-packaging
VERSION=$(get_version_from_image ${IMAGE_NAME}:${IMAGE_TAG} ${SHA})
PACKAGE_CACHE=release-${VERSION}-patch-$(git rev-parse --short=8 HEAD)
```

```
./hack/pull-packages.sh \
${IMAGE_NAME}:${IMAGE_TAG} \
${PACKAGE_CACHE}
```




1. Build the required components:

```
export DIST_DIR=$(pwd)/${PACKAGE_CACHE}/packages
./scripts/build-packages.sh ${TARGETS}
```

Where `${TARGETS}` is any combination of:
- `ubuntu18.04-arm64`
- `ubuntu18.04-amd64`
- `ubuntu18.04-ppc64le`
- `centos7-aarch64`
- `centos7-x86_64`
- `centos8-ppc64le`

The `ppc64le` targets are generally not covered by QA, and something like:
```
./scripts/build-packages.sh ubuntu18.04-amd64 ubuntu18.04-arm64 centos7-x86_64 centos7-aarch64
```

Should be sufficient.

1. Patch the container-toolkit images:
1. The packaging image:
```
BUILD_MULTI_ARCH_IMAGES=true \
ARTIFACTS_ROOT=${PACKAGE_CACHE}/packages \
VERSION=$(git rev-parse --short=8 HEAD) \
make -f deployments/container/Makefile build-packaging
```

The other images:
```
BUILD_MULTI_ARCH_IMAGES=true \
ARTIFACTS_ROOT=${PACKAGE_CACHE}/packages \
VERSION=$(git rev-parse --short=8 HEAD) \
make -f deployments/container/Makefile build-ubuntu20.04
```

```
BUILD_MULTI_ARCH_IMAGES=true \
ARTIFACTS_ROOT=${PACKAGE_CACHE}/packages \
VERSION=$(git rev-parse --short=8 HEAD) \
make -f deployments/container/Makefile build-ubi8
```

Note that even though the other packages were not updated we still regenearate
both images so as to ensure consistent image versioning.


1. Push the updated packages to the kitmaker repository:

```
export ARTIFACTS_DIR=$(pwd)/release-${VERSION}-patch-$(git rev-parse --short=8 HEAD)-artifacts
```

```
./scripts/extract-packages.sh nvidia/container-toolkit:$(git rev-parse --short=8 HEAD)-packaging
```


```
./scripts/release-kitmaker-artifactory.sh \
"https://urm.nvidia.com/artifactory/sw-gpu-cloudnative-generic-local/kitmaker"
```

```
regctl login nvcr.io -u \$oauthtoken
```

```
BUILD_MULTI_ARCH_IMAGES=true \
ARTIFACTS_ROOT=${PACKAGE_CACHE}/packages \
VERSION=$(git rev-parse --short=8 HEAD) \
OUT_IMAGE_NAME=nvcr.io/ea-cnt/nv_only/container-toolkit \
make -f deployments/container/Makefile push-ubuntu20.04
```