mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-03-31 15:47:13 +00:00
Merge branch 'update-ci' into 'master'
Update CI to use build image directly See merge request nvidia/container-toolkit/container-toolkit!53
This commit is contained in:
commit
28f6b7c02c
@ -20,23 +20,29 @@ default:
|
|||||||
variables:
|
variables:
|
||||||
IMAGE: "${CI_REGISTRY_IMAGE}"
|
IMAGE: "${CI_REGISTRY_IMAGE}"
|
||||||
IMAGE_TAG: "${CI_COMMIT_REF_SLUG}"
|
IMAGE_TAG: "${CI_COMMIT_REF_SLUG}"
|
||||||
|
BUILDIMAGE: "${CI_REGISTRY_IMAGE}/build:${CI_COMMIT_SHORT_SHA}"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- image
|
||||||
|
- lint
|
||||||
|
- go-checks
|
||||||
|
- go-build
|
||||||
|
- unit-tests
|
||||||
|
- build
|
||||||
|
- build-long
|
||||||
|
- scan
|
||||||
|
- release
|
||||||
|
|
||||||
build-dev-image:
|
build-dev-image:
|
||||||
stage: image
|
stage: image
|
||||||
before_script:
|
|
||||||
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
|
||||||
script:
|
script:
|
||||||
- apk --no-cache add make bash
|
- apk --no-cache add make bash
|
||||||
- make .build-image
|
- make .build-image
|
||||||
|
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
||||||
- make .push-build-image
|
- make .push-build-image
|
||||||
|
|
||||||
.requires-build-image:
|
.requires-build-image:
|
||||||
variables:
|
image: "${BUILDIMAGE}"
|
||||||
SKIP_IMAGE_BUILD: "yes"
|
|
||||||
before_script:
|
|
||||||
- apk --no-cache add make bash
|
|
||||||
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
|
||||||
- make .pull-build-image
|
|
||||||
|
|
||||||
.go-check:
|
.go-check:
|
||||||
extends:
|
extends:
|
||||||
@ -47,45 +53,45 @@ fmt:
|
|||||||
extends:
|
extends:
|
||||||
- .go-check
|
- .go-check
|
||||||
script:
|
script:
|
||||||
- make docker-assert-fmt
|
- make assert-fmt
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
extends:
|
extends:
|
||||||
- .go-check
|
- .go-check
|
||||||
script:
|
script:
|
||||||
- make docker-vet
|
- make vet
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
extends:
|
extends:
|
||||||
- .go-check
|
- .go-check
|
||||||
script:
|
script:
|
||||||
- make docker-lint
|
- make lint
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
ineffassign:
|
ineffassign:
|
||||||
extends:
|
extends:
|
||||||
- .go-check
|
- .go-check
|
||||||
script:
|
script:
|
||||||
- make docker-ineffassign
|
- make ineffassign
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
misspell:
|
misspell:
|
||||||
extends:
|
extends:
|
||||||
- .go-check
|
- .go-check
|
||||||
script:
|
script:
|
||||||
- make docker-misspell
|
- make misspell
|
||||||
|
|
||||||
go-build:
|
go-build:
|
||||||
extends:
|
extends:
|
||||||
- .requires-build-image
|
- .requires-build-image
|
||||||
stage: go-build
|
stage: go-build
|
||||||
script:
|
script:
|
||||||
- make docker-build
|
- make build
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
extends:
|
extends:
|
||||||
- .requires-build-image
|
- .requires-build-image
|
||||||
stage: unit-tests
|
stage: unit-tests
|
||||||
script:
|
script:
|
||||||
- make docker-coverage
|
- make coverage
|
||||||
|
|
||||||
|
@ -15,17 +15,6 @@
|
|||||||
include:
|
include:
|
||||||
- .common-ci.yml
|
- .common-ci.yml
|
||||||
|
|
||||||
stages:
|
|
||||||
- image
|
|
||||||
- go-checks
|
|
||||||
- go-build
|
|
||||||
- unit-tests
|
|
||||||
- test
|
|
||||||
- scan
|
|
||||||
- release
|
|
||||||
- build-one
|
|
||||||
- build-all
|
|
||||||
|
|
||||||
.build-setup:
|
.build-setup:
|
||||||
before_script:
|
before_script:
|
||||||
- apk update
|
- apk update
|
||||||
@ -42,7 +31,7 @@ stages:
|
|||||||
.build-one-setup:
|
.build-one-setup:
|
||||||
extends:
|
extends:
|
||||||
- .build-setup
|
- .build-setup
|
||||||
stage: build-one
|
stage: build
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_MERGE_REQUEST_ID
|
- if: $CI_MERGE_REQUEST_ID
|
||||||
|
|
||||||
@ -59,7 +48,7 @@ stages:
|
|||||||
.build-all-setup:
|
.build-all-setup:
|
||||||
extends:
|
extends:
|
||||||
- .build-setup
|
- .build-setup
|
||||||
stage: build-all
|
stage: build-long
|
||||||
timeout: 2h 30m
|
timeout: 2h 30m
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
|
@ -19,8 +19,7 @@ where `TARGET` is a make target that is valid for each of the sub-components.
|
|||||||
|
|
||||||
These include:
|
These include:
|
||||||
* `ubuntu18.04-amd64`
|
* `ubuntu18.04-amd64`
|
||||||
* `docker-all`
|
* `centos8-x86_64`
|
||||||
with the later generating for all supported distribution and platform combinations.
|
|
||||||
|
|
||||||
The packages are generated in the `dist` folder.
|
The packages are generated in the `dist` folder.
|
||||||
|
|
||||||
@ -33,62 +32,14 @@ environment variables.
|
|||||||
|
|
||||||
## Testing packages locally
|
## Testing packages locally
|
||||||
|
|
||||||
### Ubuntu
|
The [test/release](./test/release/) folder contains documentation on how the installation of local or staged packages can be tested.
|
||||||
|
|
||||||
Launch a docker container:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run --rm -it \
|
|
||||||
-v $(pwd):/work \
|
|
||||||
-v $(pwd)/dist/ubuntu18.04/amd64:/local-repository \
|
|
||||||
-w /work \
|
|
||||||
ubuntu:18.04
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
```
|
## Releasing
|
||||||
apt-get update && apt-get install -y apt-utils
|
|
||||||
```
|
|
||||||
|
|
||||||
|
A utility script [`scripts/release.sh`](./scripts/release.sh) is provided to build
|
||||||
|
packages required for release. If run without arguments, all supported distribution-architecture combinations are built. A specific distribution-architecture pair can also be provided
|
||||||
|
```sh
|
||||||
|
./scripts/release.sh ubuntu18.04-amd64
|
||||||
```
|
```
|
||||||
echo "deb [trusted=yes] file:/local-repository/ ./" > /etc/apt/sources.list.d/local.list
|
where the `amd64` builds for `ubuntu18.04` are provided as an example.
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
cd /local-repository && apt-ftparchive packages . > Packages
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
apt-get update
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Centos
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run --rm -it \
|
|
||||||
-v $(pwd):/work \
|
|
||||||
-v $(pwd)/dist/centos8/x86_64:/local-repository \
|
|
||||||
-w /work \
|
|
||||||
centos:8
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
yum install -y createrepo
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
createrepo /local-repository
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
cat >/etc/yum.repos.d/local.repo <<EOL
|
|
||||||
[local]
|
|
||||||
name=NVIDIA Container Toolkit Local Packages
|
|
||||||
baseurl=file:///local-repository
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
protect=1
|
|
||||||
EOL
|
|
||||||
```
|
|
||||||
|
9
Makefile
9
Makefile
@ -27,12 +27,13 @@ MODULE := github.com/NVIDIA/nvidia-container-toolkit
|
|||||||
docker-native:
|
docker-native:
|
||||||
include $(CURDIR)/docker/docker.mk
|
include $(CURDIR)/docker/docker.mk
|
||||||
|
|
||||||
ifeq ($(IMAGE),)
|
ifeq ($(IMAGE_NAME),)
|
||||||
REGISTRY ?= nvidia
|
REGISTRY ?= nvidia
|
||||||
IMAGE=$(REGISTRY)/container-toolkit
|
IMAGE_NAME = $(REGISTRY)/container-toolkit
|
||||||
endif
|
endif
|
||||||
IMAGE_TAG ?= $(GOLANG_VERSION)
|
|
||||||
BUILDIMAGE ?= $(IMAGE):$(IMAGE_TAG)-devel
|
BUILDIMAGE_TAG ?= golang$(GOLANG_VERSION)
|
||||||
|
BUILDIMAGE ?= $(IMAGE_NAME)-build:$(BUILDIMAGE_TAG)
|
||||||
|
|
||||||
EXAMPLES := $(patsubst ./examples/%/,%,$(sort $(dir $(wildcard ./examples/*/))))
|
EXAMPLES := $(patsubst ./examples/%/,%,$(sort $(dir $(wildcard ./examples/*/))))
|
||||||
EXAMPLE_TARGETS := $(patsubst %,example-%, $(EXAMPLES))
|
EXAMPLE_TARGETS := $(patsubst %,example-%, $(EXAMPLES))
|
||||||
|
Loading…
Reference in New Issue
Block a user