Skip to content

Commit 2aee266

Browse files
authored
Gate Docker login and snstage image usage on streamnativebot actor (#2029)
* Initial plan * Remove Docker login from CI by switching to public Apache Pulsar images The CI workflows logged in to Docker Hub to pull a private StreamNative image (snstage/pulsar-all). This is no longer needed since the public Apache Pulsar image (apachepulsar/pulsar-all) can be used instead. - Remove docker login steps from all 5 CI workflow files - Switch Dockerfile base image from snstage/pulsar-all to apachepulsar/pulsar-all - Update default Pulsar version from 4.1.0.10 to 4.0.3 Co-authored-by: zymap <24502569+zymap@users.noreply.github.com> * Update Pulsar version from 4.0.3 to 4.1.3 Co-authored-by: zymap <24502569+zymap@users.noreply.github.com> * Re-add Docker login in CI workflows conditioned on github.actor == 'streamnativebot' Co-authored-by: zymap <24502569+zymap@users.noreply.github.com> * Use snstage/pulsar-all image for streamnativebot, apachepulsar/pulsar-all for others
1 parent 90df904 commit 2aee266

7 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/ci-auth-checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Login SN docker hub
16+
if: github.actor == 'streamnativebot'
1617
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
1718
- name: Run token tests
1819
run: scripts/run-integration-tests.sh token
20+
env:
21+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}
1922
- name: Run TLS tests
2023
run: scripts/run-integration-tests.sh tls
24+
env:
25+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}

.github/workflows/ci-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Login SN docker hub
15+
if: github.actor == 'streamnativebot'
1516
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
1617
- uses: actions/checkout@v2
1718
- name: Run tests
1819
run: scripts/run-integration-tests.sh
20+
env:
21+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}

.github/workflows/ci-functions-checks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Login SN docker hub
15+
if: github.actor == 'streamnativebot'
1516
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
1617
- name: Set up Go 1.25.8
1718
uses: actions/setup-go@v6
@@ -22,13 +23,16 @@ jobs:
2223
uses: actions/checkout@v2
2324
- name: Function tests
2425
run: scripts/run-integration-tests.sh function
26+
env:
27+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}
2528
- name: Setup tmate session
2629
if: failure()
2730
uses: mxschmitt/action-tmate@v3
2831
sink-tests:
2932
runs-on: ubuntu-latest
3033
steps:
3134
- name: Login SN docker hub
35+
if: github.actor == 'streamnativebot'
3236
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
3337
- name: Set up Go 1.25.8
3438
uses: actions/setup-go@v6
@@ -39,10 +43,13 @@ jobs:
3943
uses: actions/checkout@v2
4044
- name: Sink tests
4145
run: scripts/run-integration-tests.sh sink
46+
env:
47+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}
4248
source-tests:
4349
runs-on: ubuntu-latest
4450
steps:
4551
- name: Login SN docker hub
52+
if: github.actor == 'streamnativebot'
4653
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
4754
- name: Set up Go 1.25.8
4855
uses: actions/setup-go@v6
@@ -53,3 +60,5 @@ jobs:
5360
uses: actions/checkout@v2
5461
- name: Source tests
5562
run: scripts/run-integration-tests.sh source
63+
env:
64+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}

.github/workflows/ci-install-script-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Login SN docker hub
14+
if: github.actor == 'streamnativebot'
1415
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
1516
- name: Check out code into the Go module directory
1617
uses: actions/checkout@v2

.github/workflows/ci-packages-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Login SN docker hub
15+
if: github.actor == 'streamnativebot'
1516
run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}"
1617
- name: Set up Go 1.25.8
1718
uses: actions/setup-go@v5
@@ -22,6 +23,8 @@ jobs:
2223
uses: actions/checkout@v2
2324
- name: Packages tests
2425
run: scripts/run-integration-tests.sh packages
26+
env:
27+
PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }}
2528
- name: Setup tmate session
2629
if: failure()
2730
uses: mxschmitt/action-tmate@v3

scripts/run-integration-tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ set -e
33

44
readonly PROJECT_ROOT=`cd $(dirname $0)/..; pwd`
55
readonly IMAGE_NAME=pulsarctl-test
6-
readonly PULSAR_DEFAULT_VERSION="4.1.0.10"
6+
readonly PULSAR_DEFAULT_VERSION="4.1.3"
77
readonly PULSAR_VERSION=${PULSAR_VERSION:-${PULSAR_DEFAULT_VERSION}}
8+
readonly PULSAR_IMAGE=${PULSAR_IMAGE:-"apachepulsar/pulsar-all"}
89

910
docker build --build-arg PULSAR_VERSION=${PULSAR_VERSION} \
11+
--build-arg PULSAR_IMAGE=${PULSAR_IMAGE} \
1012
-t ${IMAGE_NAME} \
1113
-f ${PROJECT_ROOT}/scripts/test-docker/Dockerfile ${PROJECT_ROOT}
1214
case ${1} in

scripts/test-docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
ARG PULSAR_IMAGE=apachepulsar/pulsar-all
12
ARG PULSAR_VERSION
2-
FROM snstage/pulsar-all:$PULSAR_VERSION
3+
FROM ${PULSAR_IMAGE}:${PULSAR_VERSION}
34

45
# use root user
56
USER root

0 commit comments

Comments
 (0)