forked from Azure/AgentBaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use manifest install for containerd, add some manifest schema validat…
…ion (Azure#1467)
- Loading branch information
1 parent
effdf5c
commit 6e23ce9
Showing
15 changed files
with
209 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Validate component manifest | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
environment: test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: 'install cue' | ||
run: | | ||
go version | ||
GOPATH="$(go env | grep GOPATH | cut -d= -f2 | tr -d '"')" | ||
export PATH="$PATH:$GOPATH/bin" | ||
pushd /tmp | ||
GO111MODULE=on go get cuelang.org/go/cmd/cue | ||
popd | ||
- name: 'validate components.json' | ||
run: | | ||
GOPATH="$(go env | grep GOPATH | cut -d= -f2 | tr -d '"')" | ||
export PATH="$PATH:$GOPATH/bin" | ||
cue vet ./schemas/manifest.cue ./vhdbuilder/packer/manifest.json | ||
cue eval ./schemas/manifest.cue ./vhdbuilder/packer/manifest.json | ||
- name: 'validate components.json' | ||
run: | | ||
GOPATH="$(go env | grep GOPATH | cut -d= -f2 | tr -d '"')" | ||
export PATH="$PATH:$GOPATH/bin" | ||
cue vet ./schemas/components.cue ./vhdbuilder/packer/components.json | ||
cue eval ./schemas/components.cue ./vhdbuilder/packer/components.json | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package components | ||
|
||
#ContainerImage: { | ||
downloadURL: string | ||
amd64OnlyVersions: [...string] | ||
multiArchVersions: [...] | ||
} | ||
|
||
#DownloadFile: { | ||
fileName: string | ||
downloadLocation: string | ||
downloadURL: string | ||
versions: [...string] | ||
targetContainerRuntime?: "containerd" | _|_ | ||
} | ||
|
||
#Images: [...#ContainerImage] | ||
#Files: [...#DownloadFile] | ||
|
||
#Components: { | ||
ContainerImages: #Images | ||
DownloadFiles: #Files | ||
} | ||
|
||
#Components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// this manifest drives component versions installed during vhd build + cse | ||
// this file is similar in nature to components.json, but allows broader customization per component | ||
// it also inverts the key order to make specific components more easily patchable via automation (kubelet, containerd) | ||
// it's effectively json, but written using cuelang for schema validation | ||
// export it to json with cue export manifest.cue | ||
|
||
// some basic json constraints for validation | ||
#dep: { | ||
fileName: string | ||
downloadLocation: string | ||
downloadURL: string | ||
versions: [...string] | ||
installedVersion: string | ||
} | ||
|
||
// semver with a revision e.g. 1.4.12-2 | ||
#containerd_ver: =~"[0-9]+.[0-9]+.[0-9]+-[0-9]+" | ||
|
||
// containerd includes constraints from #dep and tighter bounds on version | ||
#containerd: #dep & { | ||
versions: [...#containerd_ver] | ||
} | ||
|
||
#runc_ver: =~"[0-9]+.[0-9]+.[0-9]+-(rc)?[0-9]+" // rc92,rc95 previously used. | ||
|
||
#runc: #dep & { | ||
versions: [...#runc_ver] | ||
} | ||
|
||
// root object schema enforced against manifest.json | ||
#root: { | ||
runc: #runc | ||
containerd: #containerd | ||
"nvidia-container-runtime": #runc // demo failure case | ||
[string]: #dep | ||
} | ||
|
||
#root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,4 +478,4 @@ | |
"targetContainerRuntime": "containerd" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"containerd": { | ||
"fileName": "moby-containerd_${CONTAINERD_VERSION}+azure-${CONTAINERD_PATCH_VERSION}.deb", | ||
"downloadLocation": "/opt/containerd/downloads", | ||
"downloadURL": "https://moby.blob.core.windows.net/moby/moby-containerd/${CONTAINERD_VERSION}+azure/bionic/linux_${CPU_ARCH}/moby-containerd_${CONTAINERD_VERSION}+azure-${CONTAINERD_PATCH_VERSION}_${CPU_ARCH}.deb", | ||
"versions": [ | ||
"1.4.9-3", | ||
"1.4.12-2" | ||
], | ||
"installedVersion": "1.5.9-2" | ||
}, | ||
"runc": { | ||
"fileName": "moby-runc_${RUNC_VERSION}+azure-${RUNC_PATCH_VERSION}.deb", | ||
"downloadLocation": "/opt/runc/downloads", | ||
"downloadURL": "https://moby.blob.core.windows.net/moby/moby-runc/${RUNC_VERSION}+azure/bionic/linux_${CPU_ARCH}/moby-runc_${RUNC_VERSION}+azure-${RUNC_PATCH_VERSION}_${CPU_ARCH}.deb", | ||
"versions": [ | ||
"1.0.0-rc92", | ||
"1.0.0-rc95" | ||
], | ||
"installedVersion": "1.0.3" | ||
}, | ||
"nvidia-container-runtime": { | ||
"fileName": "", | ||
"downloadLocation": "", | ||
"downloadURL": "", | ||
"versions": [], | ||
"installedVersion": "" | ||
}, | ||
"nvidia-drivers": { | ||
"fileName": "", | ||
"downloadLocation": "", | ||
"downloadURL": "", | ||
"versions": [], | ||
"installedVersion": "" | ||
}, | ||
"_template": { | ||
"fileName": "", | ||
"downloadLocation": "", | ||
"downloadURL": "", | ||
"versions": [], | ||
"installedVersion": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters