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

Deprecate loadimpact docker image #3121

Merged
merged 6 commits into from
Jun 19, 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
34 changes: 24 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
with:
fetch-depth: 0
- name: Build
run: docker build -t $DOCKER_IMAGE_ID .
run: docker build --target release -t $DOCKER_IMAGE_ID .
- name: Check
run: |
docker run $DOCKER_IMAGE_ID version
Expand Down Expand Up @@ -187,27 +187,41 @@ jobs:
- name: Publish k6:master image to Docker Hub
if: ${{ github.ref == 'refs/heads/master' }}
run: |
echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:master and $LI_DOCKER_IMAGE_ID:master"
echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:master"
docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:master"
docker tag "$DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:master"
docker push "$DOCKER_IMAGE_ID:master"
docker push "$LI_DOCKER_IMAGE_ID:master"
- name: Publish tagged version image to Docker Hub
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
# We need to push the same image in both the loadimpact and the grafana docker hub orgs
VERSION="${VERSION#v}"
echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:$VERSION and $LI_DOCKER_IMAGE_ID:$VERSION"
echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:$VERSION"
docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:$VERSION"
docker tag "$DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:$VERSION"
docker push "$DOCKER_IMAGE_ID:$VERSION"
docker push "$LI_DOCKER_IMAGE_ID:$VERSION"
# We also want to tag the latest stable version as latest
if [[ ! "$VERSION" =~ (RC|rc) ]]; then
echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:latest and $LI_DOCKER_IMAGE_ID:latest"
echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:latest"
docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:latest"
docker tag "$DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:latest"
docker push "$DOCKER_IMAGE_ID:latest"
fi
- name: Build loadimpact/k6
run: docker build -t $LI_DOCKER_IMAGE_ID .
- name: Publish loadimpact/k6:master image to Docker Hub
if: ${{ github.ref == 'refs/heads/master' }}
run: |
echo "Publish to Docker Hub as $LI_DOCKER_IMAGE_ID:master"
docker tag "$LI_DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:master"
docker push "$LI_DOCKER_IMAGE_ID:master"
- name: Publish loadimpact/k6 tagged version image to Docker Hub
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
VERSION="${VERSION#v}"
echo "Publish to Docker Hub as $LI_DOCKER_IMAGE_ID:$VERSION"
docker tag "$LI_DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:$VERSION"
docker push "$LI_DOCKER_IMAGE_ID:$VERSION"
# We also want to tag the latest stable version as latest
if [[ ! "$VERSION" =~ (RC|rc) ]]; then
echo "Publish to Docker Hub as $LI_DOCKER_IMAGE_ID:latest"
docker tag "$LI_DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:latest"
docker push "$LI_DOCKER_IMAGE_ID:latest"
fi

Expand Down
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ COPY . .
RUN apk --no-cache add git=~2
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X go.k6.io/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --tags --always --long --dirty)"

FROM alpine:3.17
# Runtime stage
FROM alpine:3.17 as release

# hadolint ignore=DL3018
RUN apk add --no-cache ca-certificates && \
adduser -D -u 12345 -g 12345 k6
COPY --from=builder /go/bin/k6 /usr/bin/k6

USER 12345
USER k6
WORKDIR /home/k6

ENTRYPOINT ["k6"]

# Legacy loadimpact/k6 image
FROM release

COPY entrypoint-legacy.sh /usr/bin/

ENTRYPOINT ["/usr/bin/entrypoint-legacy.sh"]
13 changes: 13 additions & 0 deletions entrypoint-legacy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

cat >&2 <<-EOF
+------------------------------------------------------------------------------+
| WARNING: The loadimpact/k6 Docker image has been replaced by grafana/k6. |
| THIS IMAGE IS DEPRECATED and its support will be discontinued after |
| Dec 31, 2023. Please update your scripts to use grafana/k6 to |
Comment on lines +6 to +7
Copy link
Contributor

@imiric imiric Jun 15, 2023

Choose a reason for hiding this comment

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

That's a good timeframe 👍

The idea is that by "discontinued" we mean that we will stop pushing new k6 releases to it, but it will still work with this warning. And some time after that (6 months?) we would push the exit 1 change, and a bit more after that (another 6 months?) we would delete the loadimpact namespace altogether.

Is this mostly the plan, pending timeframe agreements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe we can decide on how much do we want to push users to upgrade later. Personally I become more and more reluctant to adding exit 1. Not publishing new releases to the loadimpact org might be good enough.

Copy link
Contributor

@imiric imiric Jun 16, 2023

Choose a reason for hiding this comment

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

Personally I become more and more reluctant to adding exit 1. Not publishing new releases to the loadimpact org might be good enough.

exit 1 is part of making a gradual change. The first step is this deprecation warning; the next step is to stop pushing to loadimpact/k6; then some time after that we push a final image to make k6 tests start failing with exit 1 so that users will actually notice the warning; and the final step is removing the loadimpact org, where CI builds would fail much earlier.

I suppose there's no harm in letting old images of k6 there forever, but we do want users to upgrade to new versions, and since Load Impact is not an entity anymore, there's no sense in keeping the org around. This way we avoid some Docker Inc. manager deciding again that maybe OSS projects should start paying for the data and traffic 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe once the EOL date has passed, we can retire loadimpact anytime should such decision be made.

| continue using the latest version of k6. |
+------------------------------------------------------------------------------+

EOF

/usr/bin/k6 "$@"