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

Fixes ppc64le setup for Knative #36

Merged
merged 1 commit into from
Dec 5, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ on:

jobs:
test:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2022 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -29,13 +29,13 @@ COPY . /code/

# See from a previously published version to avoid pulling from Docker Hub (docker.io)
# This version is only used to install the real version
FROM ghcr.io/openzipkin/alpine:3.16.2 as install
FROM ghcr.io/openzipkin/alpine:3.18.5 as install

WORKDIR /code
# Conditions aren't supported in Dockerfile instructions, so we copy source even if it isn't used.
COPY --from=code /code/ .

# Alpine's minirootfs is mirrored and only 5MB. Build on demand instead of consuming docker.io pulls
Copy link
Member Author

Choose a reason for hiding this comment

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

perhaps this confused folks to think the file was a binary not a script.

# Alpine's minirootfs is mirrored and only 5MB. wget on demand instead of consuming docker.io pulls
WORKDIR /install

ARG alpine_version
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ This is an internal base layer primarily used in [docker-java](https://github.co

To browse the image, run it in interactive mode with TTY enabled like so:
```bash
docker run -ti --rm ghcr.io/openzipkin/alpine:3.18.2
docker run -ti --rm ghcr.io/openzipkin/alpine:3.18.5
/ #
```

## Release process
Build the `Dockerfile` using the current version from https://alpinelinux.org/downloads/:
```bash
# Note 3.18.2 not 3.18!
./build-bin/build 3.18.2
# Note 3.18.5 not 3.18!
./build-bin/build 3.18.5
```

Next, verify the built image matches that version:
```bash
docker run --rm openzipkin/alpine:test -c 'cat /etc/alpine-release'
3.18.2
3.18.5
```

To release the image, push a tag matching the arg to `build-bin/build` (ex `3.18.2`).
To release the image, push a tag matching the arg to `build-bin/build` (ex `3.18.5`).
This triggers a [GitHub Actions](https://github.com/openzipkin/docker-alpine/actions) job to push the image.
9 changes: 7 additions & 2 deletions alpine_minirootfs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2020 The OpenZipkin Authors
# Copyright 2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -17,11 +17,13 @@ set -eu

# This downloads and extracts the indicated version alpine-minirootfs into the current directory.

full_version=${1?full_version ex 3.18.2}
full_version=${1?full_version ex 3.18.5}
version=$(echo "${full_version}" | sed -En "s/^([0-9]+\.[0-9]+)\.[0-9]+$/\1/p")
patch=$(echo "${full_version}" | cut -f3 -d.)

# Normalize arch to what's available
#
# Note: s390x and ppc64le were added for Knative
arch=$(uname -m)
case ${arch} in
amd64* )
Expand All @@ -39,6 +41,9 @@ case ${arch} in
s390x* )
arch=s390x
;;
ppc64le* )
Copy link
Member Author

Choose a reason for hiding this comment

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

this was the spot missed

arch=ppc64le
;;
* )
>&2 echo "Unsupported arch: ${arch}"
exit 1;
Expand Down
7 changes: 6 additions & 1 deletion build-bin/docker/docker_arch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2020 The OpenZipkin Authors
# Copyright 2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -21,6 +21,8 @@
set -ue

# Normalize docker_arch to what's available
#
# Note: s390x and ppc64le were added for Knative
docker_arch=${DOCKER_ARCH:-$(uname -m)}
case ${docker_arch} in
amd64* )
Expand All @@ -38,6 +40,9 @@ case ${docker_arch} in
s390x* )
docker_arch=s390x
;;
ppc64le* )
docker_arch=ppc64le
;;
* )
>&2 echo "Unsupported DOCKER_ARCH: ${docker_arch}"
exit 1;
Expand Down
5 changes: 3 additions & 2 deletions build-bin/docker/docker_push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2020 The OpenZipkin Authors
# Copyright 2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -64,7 +64,8 @@ for repo in ${docker_repos}; do
done

docker_args=$($(dirname "$0")/docker_args ${version})
docker_archs=${DOCKER_ARCHS:-amd64 arm64 s390x}
# Note: s390x and ppc64le were added for Knative
docker_archs=${DOCKER_ARCHS:-amd64 arm64 s390x ppc64le}

echo "Will build the following architectures: ${docker_archs}"

Expand Down