Skip to content

Commit

Permalink
Use containerd from Docker packages when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciprian Hacman committed Jun 12, 2020
1 parent eedd4af commit c5f8822
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
25 changes: 17 additions & 8 deletions nodeup/pkg/model/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,25 @@ var containerdVersions = []packageVersion{
PackageVersion: "1.2.10",
PlainBinary: true,
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://storage.googleapis.com/cri-containerd-release/cri-containerd-1.2.10.linux-amd64.tar.gz",
Hash: "9125a6ae5a89dfe9403fea7d03a8d8ba9fa97b6863ee8698c4e6c258fb14f1fd",
Source: "https://download.docker.com/linux/static/stable/x86_64/docker-19.03.4.tgz",
Hash: "efef2ad32d262674501e712351be0df9dd31d6034b175d0020c8f5d5c9c3fd10",
MapFiles: map[string]string{
"docker/c*": "/usr/bin",
"docker/runc": "/usr/bin",
},
},

// 1.2.13 - Linux Generic
{
PackageVersion: "1.2.13",
PlainBinary: true,
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://storage.googleapis.com/cri-containerd-release/cri-containerd-1.2.13.linux-amd64.tar.gz",
Hash: "92d6ae6c60f6b068652b31811ce23d650ec0f6cc1e618ec9ae23db9321956258",
Source: "https://download.docker.com/linux/static/stable/x86_64/docker-19.03.11.tgz",
Hash: "0f4336378f61ed73ed55a356ac19e46699a995f2aff34323ba5874d131548b9e",
MapFiles: map[string]string{
"docker/c*": "/usr/bin",
"docker/runc": "/usr/bin",
},
},

// 1.3.4 - Linux Generic
Expand All @@ -76,6 +84,10 @@ var containerdVersions = []packageVersion{
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://storage.googleapis.com/cri-containerd-release/cri-containerd-1.3.4.linux-amd64.tar.gz",
Hash: "4616971c3ad21c24f2f2320fa1c085577a91032a068dd56a41c7c4b71a458087",
MapFiles: map[string]string{
"./usr/local/bin": "/usr",
"./usr/local/sbin": "/usr",
},
},

// TIP: When adding the next version, copy the previous version, string replace the version and run:
Expand Down Expand Up @@ -165,11 +177,8 @@ func (b *ContainerdBuilder) Build(c *fi.ModelBuilderContext) error {
Name: "containerd.io",
Source: dv.Source,
Hash: dv.Hash,
MapFiles: dv.MapFiles,
TargetDir: "/",
MapFiles: map[string]string{
"./usr/local/bin": "/usr",
"./usr/local/sbin": "/usr",
},
}
c.AddTask(packageTask)
} else {
Expand Down
2 changes: 2 additions & 0 deletions nodeup/pkg/model/convenience.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ type packageVersion struct {

// PlainBinary indicates that the Source is not an OS, but a "bare" tar.gz
PlainBinary bool
// MapFiles is the list of files to extract with corresponding directories for PlainBinary
MapFiles map[string]string

// MarkImmutable is a list of files on which we should perform a `chattr +i <file>`
MarkImmutable []string
Expand Down
16 changes: 13 additions & 3 deletions nodeup/pkg/model/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ var dockerVersions = []packageVersion{
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://download.docker.com/linux/static/stable/x86_64/docker-18.09.9.tgz",
Hash: "82a362af7689038c51573e0fd0554da8703f0d06f4dfe95dd5bda5acf0ae45fb",
MapFiles: map[string]string{
"docker/docker*": "/usr/bin",
},
},

// 19.03.4 - Linux Generic
Expand All @@ -314,6 +317,9 @@ var dockerVersions = []packageVersion{
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://download.docker.com/linux/static/stable/x86_64/docker-19.03.4.tgz",
Hash: "efef2ad32d262674501e712351be0df9dd31d6034b175d0020c8f5d5c9c3fd10",
MapFiles: map[string]string{
"docker/docker*": "/usr/bin",
},
},

// 19.03.8 - Linux Generic
Expand All @@ -323,6 +329,9 @@ var dockerVersions = []packageVersion{
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://download.docker.com/linux/static/stable/x86_64/docker-19.03.8.tgz",
Hash: "7f4115dc6a3c19c917f8b9664d7b51c904def1c984e082c4600097433323cf6f",
MapFiles: map[string]string{
"docker/docker*": "/usr/bin",
},
},

// 19.03.11 - Linux Generic
Expand All @@ -332,6 +341,9 @@ var dockerVersions = []packageVersion{
Architectures: []architectures.Architecture{architectures.ArchitectureAmd64},
Source: "https://download.docker.com/linux/static/stable/x86_64/docker-19.03.11.tgz",
Hash: "0f4336378f61ed73ed55a356ac19e46699a995f2aff34323ba5874d131548b9e",
MapFiles: map[string]string{
"docker/docker*": "/usr/bin",
},
},

// TIP: When adding the next version, copy the previous version, string replace the version and run:
Expand Down Expand Up @@ -406,10 +418,8 @@ func (b *DockerBuilder) Build(c *fi.ModelBuilderContext) error {
Name: "docker-ce",
Source: dv.Source,
Hash: dv.Hash,
MapFiles: dv.MapFiles,
TargetDir: "/",
MapFiles: map[string]string{
"docker/docker*": "/usr/bin",
},
}
c.AddTask(packageTask)

Expand Down
8 changes: 4 additions & 4 deletions nodeup/pkg/model/tests/containerdbuilder/simple/tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Name: containerd.io
hash: 9125a6ae5a89dfe9403fea7d03a8d8ba9fa97b6863ee8698c4e6c258fb14f1fd
hash: efef2ad32d262674501e712351be0df9dd31d6034b175d0020c8f5d5c9c3fd10
mapFiles:
./usr/local/bin: /usr
./usr/local/sbin: /usr
source: https://storage.googleapis.com/cri-containerd-release/cri-containerd-1.2.10.linux-amd64.tar.gz
docker/c*: /usr/bin
docker/runc: /usr/bin
source: https://download.docker.com/linux/static/stable/x86_64/docker-19.03.4.tgz
target: /
---
contents: |-
Expand Down

0 comments on commit c5f8822

Please sign in to comment.