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

Support upload image to aws #601

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b9b2eaf
Support upload image to aws
tuteng Apr 7, 2022
92477a8
Fixed file permission
tuteng Apr 7, 2022
b87f632
Update action yml file
tuteng Apr 7, 2022
9d4f108
Update image action yml file
tuteng Apr 7, 2022
41dfd0b
Update version check
tuteng Apr 7, 2022
727ee97
Test download image
tuteng Apr 7, 2022
e65d751
Update var
tuteng Apr 7, 2022
1587acb
Update upload file
tuteng Apr 11, 2022
59d166f
Fixed upload bucket name
tuteng Apr 11, 2022
3ae1ca6
Debug ali oss
tuteng Apr 11, 2022
c379c8c
Fixed command
tuteng Apr 11, 2022
9cbc3d0
Update ali oss config
tuteng Apr 11, 2022
43f7c8c
Fixed bucket
tuteng Apr 11, 2022
53f4efb
Fixed dest path
tuteng Apr 11, 2022
5d3c125
Fixed image save command
tuteng Apr 11, 2022
c972c47
Fixed image list
tuteng Apr 11, 2022
2258992
Fixed command
tuteng Apr 11, 2022
926c651
Fixed image upload
tuteng Apr 12, 2022
5018550
Update image, and add trigger action
tuteng Apr 12, 2022
3ae05c2
Update version
tuteng Apr 12, 2022
a7e362d
Update oss version
tuteng Apr 12, 2022
0653752
Remove no used image
tuteng Apr 12, 2022
f1aec2d
Update image list
tuteng Apr 19, 2022
ce90c4f
Fixed images list
tuteng Apr 19, 2022
4131292
Fixed trigger action
tuteng Apr 19, 2022
9756a4b
Fixed echo download info
tuteng Apr 19, 2022
379d61e
Fixed sn-platform info
tuteng Apr 19, 2022
d9d6056
trigger image upload
tuteng Apr 19, 2022
ce62bbf
Update vault operator image
tuteng Apr 19, 2022
36a1391
Fixed operator image
tuteng Apr 19, 2022
c1ca157
Fixed vault operator image
tuteng Apr 19, 2022
a7a0024
Fixed image
tuteng Apr 19, 2022
80ce0d2
Echo image list
tuteng Apr 19, 2022
76849da
Push 2.9.2.12 image
tuteng Apr 19, 2022
c9098c7
Fixed 2.9.2.13 image
tuteng Apr 19, 2022
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
42 changes: 42 additions & 0 deletions .ci/download_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
components=(
zookeeper
zookeeper.customTools.backup
zookeeper.customTools.restore
bookie
presto
autorecovery
broker
proxy
pulsar_detector
functions
function_worker
toolset
toolset.kafka
prometheus
alert_manager
grafana
streamnative_console
node_exporter
nginx_ingress_controller
vault
vault_init
custom_metric_server_prometheus
custom_metric_server
pulsar_metadata
configmapReload
external_dns)
sn_platform_tag=$1
Copy link
Contributor

@jdmaguire jdmaguire Apr 7, 2022

Choose a reason for hiding this comment

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

I think you should default this or throw a help message & exit if not provided. Otherwise, someone has to open up the file to see what arguments this needs and what they are for.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm still working on this test and have some code left to finish, thanks for the suggestion, it seems I should set this pr to draft status

curl https://raw.githubusercontent.com/streamnative/charts/${sn_platform_tag}/charts/sn-platform/values.yaml -o values.yaml
image_list=""
for i in ${components[@]}; do
repository=$(cat values.yaml | yq .images.$i.repository)
tag=$(cat values.yaml | yq .images.$i.tag)
echo "Downloading docker image: $repository:$tag"
image_list=image_list" $repository:$tag"
docker pull $repository:$tag
done

# docker save -o $sn_platform_tag.tar $image_list
# test
docker save -o $sn_platform_tag.tar jimmidyson/configmap-reload:v0.3.0
34 changes: 34 additions & 0 deletions .github/workflows/sn_platform_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Upload

on:
pull_request:
branches:
- '*'

jobs:
deploy:
name: Upload sn platform image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup ACK environments
run: |
sudo apt update
sudo snap install yq

- name: Download and package all image for sn platform
run: |
.ci/download_image.sh sn-platform-1.3.1

- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: './'
DEST_DIR: 'sn-platform-1.3.1'