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

Produce linux/s390x and linux/ppc64le binaries to use in container_test #269

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ dist: trusty
arch:
- amd64
- arm64
- s390x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any interest in adding ppc64le while you are in here? 😇

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks surprisingly easy, so maybe it's a simple enough follow up. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, will check if it works for Power :)

btw, you are doing so many great things for arm64 in this direction :) Could you also take into account s390x and ppc64le then 😊 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattmoor ppc64le cross compilation works. So I added it to the PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also take into account s390x and ppc64le

Generally I am trying to anticipate a proliferation of architectures as I'm expanding the support for things, but I'm a bit reluctant to make changes where I don't have hardware to test and abusing automated testing is impractical (e.g. cases using bazel or kind). For ko I did add ko publish testing last Friday for all four of the distroless architectures, but in general these are "just" 4 of a much longer list 😉

- ppc64le

language: go
go:
Expand Down
11 changes: 11 additions & 0 deletions deploy/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ steps:
args: ['make', 'cross']
env: ['GOARCH=arm64']

# Do the go build for s390x
- name: 'builder'
args: ['make', 'cross']
env: ['GOARCH=s390x']

# Do the go build for ppc64le
- name: 'builder'
args: ['make', 'cross']
env: ['GOARCH=ppc64le']


# Upload to GCS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'out/*', 'gs://container-structure-test/builds/$COMMIT_SHA/']
Expand Down
10 changes: 10 additions & 0 deletions deploy/release_cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ steps:
args: ['make', 'cross']
env: ['GOARCH=arm64']

# Do the go build for s390x
- name: 'builder'
args: ['make', 'cross']
env: ['GOARCH=s390x']

# Do the go build for s390x
- name: 'builder'
args: ['make', 'cross']
env: ['GOARCH=ppc64le']

# Upload to GCS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'out/*', 'gs://container-structure-test/$TAG_NAME/']
Expand Down
32 changes: 32 additions & 0 deletions tests/ppc64le/ubuntu_20_04_failure_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
schemaVersion: '1.0.0'
commandTests:
- name: 'bad apt-get-command'
command: ['apt-get', 'dslkfjasl']
excludedError: ['.*FAIL.*']
expectedOutput: ['.*Usage.*']
- name: 'apt-config'
command: ['apt-config', 'dump']
expectedOutput: ['Acquire::Retries "3"']
name: 'apt-config'
- name: 'path'
command: ['sh', '-c', 'echo $PATH']
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
fileContentTests:
- name: 'Debian Sources'
excludedContents: ['.*gce_debian_mirror.*']
expectedContents: ['.*httpredir\.debian\.org.*']
path: '/etc/apt/sources.list'
- name: 'Wrong Retry Policy'
expectedContents: ['Acquire::Retries 4;']
path: '/etc/apt/apt.conf.d/apt-retry'
fileExistenceTests:
- name: 'Fake Dir'
path: '/foo/bar'
shouldExist: true
- name: 'Wrong permissions'
path: '/etc/apt/sources.list'
permissions: '-rwxrwxrwx'
shouldExist: true
licenseTests:
- debian: true
files:
22 changes: 22 additions & 0 deletions tests/ppc64le/ubuntu_20_04_metadata_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
schemaVersion: '2.0.0' # Make sure to test the latest schema version
metadataTest:
env:
- key: 'SOME_KEY'
value: 'SOME_VAL'
- key: 'EMPTY_VAR'
value: ''
- key: 'FOO_BAR'
value: 'FOO\:BAR=BAZ'
- key: 'REGEX_VAR'
value: '[a-z]+-2\.1\.*'
isRegex: true
labels:
- key: 'localnet.localdomain.commit_hash'
value: '0123456789abcdef0123456789abcdef01234567'
- key: 'localnet.my-domain.my-label'
value: 'my .+ label'
isRegex: true
- key: 'label-with-empty-val'
value: ''
unexposedPorts: ['80']
unmountedVolumes: ['/root']
45 changes: 45 additions & 0 deletions tests/ppc64le/ubuntu_20_04_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
schemaVersion: '2.0.0' # Make sure to test the latest schema version
commandTests:
- name: 'apt-get'
command: 'apt-get'
args: ['help']
excludedError: ['.*FAIL.*']
expectedOutput: ['.*Usage.*']
- name: 'apt-config'
command: 'apt-config'
args: ['dump']
expectedOutput: ['APT::AutoRemove']
- name: 'path'
command: 'sh'
args: ['-c', 'echo $PATH']
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
fileContentTests:
- name: 'Debian Sources'
excludedContents: ['.*gce_debian_mirror.*']
expectedContents: ['.*ports\.ubuntu\.com.*']
path: '/etc/apt/sources.list'
- name: 'Passwd file'
expectedContents: ['root:x:0:0:root:/root:/bin/bash']
path: '/etc/passwd'
fileExistenceTests:
- name: 'Root'
path: '/'
shouldExist: true
uid: 0
gid: 0
- name: 'Date'
path: '/bin/date'
isExecutableBy: 'owner'
- name: 'Hosts File'
path: '/etc/hosts'
shouldExist: true
- name: 'Machine ID'
path: '/etc/machine-id'
- name: 'Dummy File'
path: '/etc/dummy'
shouldExist: false
licenseTests:
- debian: false
files:
- "/usr/share/doc/ubuntu-keyring/copyright"
- "/usr/share/doc/dash/copyright"
32 changes: 32 additions & 0 deletions tests/s390x/ubuntu_20_04_failure_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
schemaVersion: '1.0.0'
commandTests:
- name: 'bad apt-get-command'
command: ['apt-get', 'dslkfjasl']
excludedError: ['.*FAIL.*']
expectedOutput: ['.*Usage.*']
- name: 'apt-config'
command: ['apt-config', 'dump']
expectedOutput: ['Acquire::Retries "3"']
name: 'apt-config'
- name: 'path'
command: ['sh', '-c', 'echo $PATH']
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
fileContentTests:
- name: 'Debian Sources'
excludedContents: ['.*gce_debian_mirror.*']
expectedContents: ['.*httpredir\.debian\.org.*']
path: '/etc/apt/sources.list'
- name: 'Wrong Retry Policy'
expectedContents: ['Acquire::Retries 4;']
path: '/etc/apt/apt.conf.d/apt-retry'
fileExistenceTests:
- name: 'Fake Dir'
path: '/foo/bar'
shouldExist: true
- name: 'Wrong permissions'
path: '/etc/apt/sources.list'
permissions: '-rwxrwxrwx'
shouldExist: true
licenseTests:
- debian: true
files:
22 changes: 22 additions & 0 deletions tests/s390x/ubuntu_20_04_metadata_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
schemaVersion: '2.0.0' # Make sure to test the latest schema version
metadataTest:
env:
- key: 'SOME_KEY'
value: 'SOME_VAL'
- key: 'EMPTY_VAR'
value: ''
- key: 'FOO_BAR'
value: 'FOO\:BAR=BAZ'
- key: 'REGEX_VAR'
value: '[a-z]+-2\.1\.*'
isRegex: true
labels:
- key: 'localnet.localdomain.commit_hash'
value: '0123456789abcdef0123456789abcdef01234567'
- key: 'localnet.my-domain.my-label'
value: 'my .+ label'
isRegex: true
- key: 'label-with-empty-val'
value: ''
unexposedPorts: ['80']
unmountedVolumes: ['/root']
45 changes: 45 additions & 0 deletions tests/s390x/ubuntu_20_04_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
schemaVersion: '2.0.0' # Make sure to test the latest schema version
commandTests:
- name: 'apt-get'
command: 'apt-get'
args: ['help']
excludedError: ['.*FAIL.*']
expectedOutput: ['.*Usage.*']
- name: 'apt-config'
command: 'apt-config'
args: ['dump']
expectedOutput: ['APT::AutoRemove']
- name: 'path'
command: 'sh'
args: ['-c', 'echo $PATH']
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
fileContentTests:
- name: 'Debian Sources'
excludedContents: ['.*gce_debian_mirror.*']
expectedContents: ['.*ports\.ubuntu\.com.*']
path: '/etc/apt/sources.list'
- name: 'Passwd file'
expectedContents: ['root:x:0:0:root:/root:/bin/bash']
path: '/etc/passwd'
fileExistenceTests:
- name: 'Root'
path: '/'
shouldExist: true
uid: 0
gid: 0
- name: 'Date'
path: '/bin/date'
isExecutableBy: 'owner'
- name: 'Hosts File'
path: '/etc/hosts'
shouldExist: true
- name: 'Machine ID'
path: '/etc/machine-id'
- name: 'Dummy File'
path: '/etc/dummy'
shouldExist: false
licenseTests:
- debian: false
files:
- "/usr/share/doc/ubuntu-keyring/copyright"
- "/usr/share/doc/dash/copyright"