Skip to content

Commit

Permalink
chore: add remaining repositories for syncing (#3676)
Browse files Browse the repository at this point in the history
* chore: add remaining repositories for syncing

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: remove re-run lock

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: use oci format

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: run on ubuntu 22.04

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: run on ubuntu 24.04

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: use ubuntu 22.04

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: test running in docker

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: cleanup

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: skip signatures

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: try oci format

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: do not abort other jobs if one fails

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: try to sync ECR images event if Docker Hub sync fails

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* feat: add kube-prometheus-stack and nginx images

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: do not sync images if login fails

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: no need to install skopeo

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: add prometheus repository

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: repository name for prometheus

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: fix repository for prometheus-operator

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

* chore: sort repositories alphabetically

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>

---------

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
  • Loading branch information
sumo-drosiek authored Apr 24, 2024
1 parent f884bb7 commit 03efe65
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 19 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/sync-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,44 @@ jobs:
strategy:
matrix:
include:
- src_repository: docker.io/bitnami/metrics-server
suffix: METRICS_SERVER
- src_repository: docker.io/busybox
suffix: BUSYBOX
- src_repository: docker.io/nginxinc/nginx-unprivileged
suffix: NGINX_UNPRIVILEGED
- src_repository: docker.io/telegraf
suffix: TELEGRAF
- src_repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet
suffix: AUTOINSTRUMENTATION_DOTNET
- src_repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java
suffix: AUTOINSTRUMENTATION_JAVA
- src_repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs
suffix: AUTOINSTRUMENTATION_NODEJS
- src_repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python
suffix: AUTOINSTRUMENTATION_PYTHON
- src_repository: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
suffix: OPENTELEMETRY_OPERATOR
- src_repository: public.ecr.aws/falcosecurity/falco-driver-loader
suffix: FALCO_DRIVER_LOADER
- src_repository: public.ecr.aws/falcosecurity/falco-no-driver
suffix: FALCO_NO_DRIVER
- src_repository: quay.io/brancz/kube-rbac-proxy
suffix: KUBE_RBAC_PROXY
- src_repository: quay.io/influxdb/telegraf-operator
suffix: TELEGRAF_OPERATOR
- src_repository: quay.io/prometheus/node-exporter
suffix: NODE_EXPORTER
- src_repository: quay.io/prometheus/prometheus
suffix: PROMETHEUS
- src_repository: quay.io/prometheus-operator/prometheus-config-reloader
suffix: PROMETHEUS_CONFIG_RELOADER
- src_repository: quay.io/prometheus-operator/prometheus-operator
suffix: PROMETHEUS_OPERATOR
- src_repository: quay.io/thanos/thanos
suffix: THANOS
- src_repository: registry.k8s.io/kube-state-metrics/kube-state-metrics
suffix: KUBE_STATE_METRICS
uses: ./.github/workflows/workflow-sync-repositories.yaml
with:
src_repository: ${{ matrix.src_repository }}
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/workflow-sync-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,11 @@ on:

jobs:
sync-repository:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
continue-on-error: true
name: ${{ inputs.src_repository }}
steps:
- name: No re-runs
run: |
if [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then
echo "It is not advised to re-run this workflow! It won't speed up the process!"
exit 1
else
echo "not a re-run, continue"
fi
- uses: actions/checkout@v4
- name: Install skopeo
run: sudo apt-get install skopeo -y
- name: Login to Docker Hub
uses: docker/login-action@v3.1.0
with:
Expand All @@ -49,11 +40,14 @@ jobs:
- name: Synchronize image to Docker Hub repository
run: ./ci/sync-repository.sh ${{ inputs.src_repository }} ${{ inputs.dest_docker_namespace }}
- name: Login to ECR
if: always()
id: loginECR
run: |-
aws ecr-public get-login-password --region us-east-1 \
| docker login --username AWS --password-stdin ${{ inputs.dest_ecr_namespace }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Synchronize image to ECR repository
if: always() && steps.loginECR.outcome == 'success'
run: ./ci/sync-repository.sh ${{ inputs.src_repository }} ${{ inputs.dest_ecr_namespace }}
18 changes: 11 additions & 7 deletions ci/sync-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

SRC_REPOSITORY=${1}
DESTINATION_NAMESPACE=${2}
skopeo sync \
-f v2s2 \
--retry-times 5 \
--src docker \
--dest docker \
"${SRC_REPOSITORY}" \
"${DESTINATION_NAMESPACE}"
docker run \
-v ~/.docker/config.json:/tmp/auth.json \
quay.io/skopeo/stable:v1.15.0 \
sync \
--keep-going \
-f oci \
--retry-times 5 \
--src docker \
--dest docker \
"${SRC_REPOSITORY}" \
"${DESTINATION_NAMESPACE}"
1 change: 0 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pkgs.mkShell {
pkgs.golangci-lint
pkgs.go
pkgs.kind
pkgs.skopeo
];
}
## Output of `make tool-versions`:
Expand Down

0 comments on commit 03efe65

Please sign in to comment.