Skip to content

Commit c4d28cc

Browse files
benjaminguttmann-avtqaramprice
authored andcommitted
[ci][publisher] Fix docker image push
- make all stemcell `put` actions parallel
1 parent cfe8aa1 commit c4d28cc

1 file changed

Lines changed: 96 additions & 76 deletions

File tree

ci/pipelines/publisher.yml

Lines changed: 96 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -467,81 +467,100 @@ jobs:
467467
KERNEL_PACKAGE: linux-generic
468468
input_mapping:
469469
candidate-stemcell: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
470-
- task: extract-warden-image
471-
image: bosh-integration-registry-image
472-
config:
473-
inputs:
474-
- name: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
475-
outputs:
476-
- name: stemcell-image
477-
platform: linux
478-
run:
479-
dir: stemcell-image
480-
path: /bin/bash
481-
args:
482-
- -ce
483-
- tar xvf ../candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/bosh-stemcell-*-warden-boshlite-(@= data.values.stemcell_details.os_name @)*.tgz image
484-
- put: github-container-registry-(@= data.values.stemcell_details.os_name @)-stemcell
485-
params:
486-
import_file: stemcell-image/image
487-
tag_file: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
488-
tag_as_latest: true
489-
- put: published-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
490-
params:
491-
files:
492-
- candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
493-
options:
494-
author_email: *ci_bot_email
495-
author_name: *ci_bot_name
496-
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
497-
rename: '{{.Version}}/stemcells.meta4'
498-
version: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
499-
#@ if len(data.values.stemcell_details.include_fips_iaas) > 0 :
500-
- put: published-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)
501-
params:
502-
files:
503-
- candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
504-
options:
505-
author_email: *ci_bot_email
506-
author_name: *ci_bot_name
507-
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)-fips/(@= str(data.values.stemcell_details.major_version) @).x'
508-
rename: '{{.Version}}/stemcells.meta4'
509-
version: candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
510-
#@ end
511-
- params:
512-
files:
513-
- candidate-aws-light-stemcell/*.tgz
514-
options:
515-
author_email: *ci_bot_email
516-
author_name: *ci_bot_name
517-
message: 'publish (light aws): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
518-
rename: '{{.Version}}/stemcells.aws.meta4'
519-
version: candidate-aws-light-stemcell/.resource/version
520-
put: published-aws-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
521-
522-
#! once we release all regions with the same account, we can unify these again
523-
- file: bosh-stemcells-ci/ci/tasks/light-aws/tag-aws-ami-light.yml
524-
image: bosh-ecosystem-concourse-registry-image
525-
task: tag-published-aws-ami-light-stemcells
526-
params:
527-
AWS_PAGER:
528-
AWS_ACCESS_KEY_ID: ((aws_publish_us_access_key))
529-
AWS_SECRET_ACCESS_KEY: ((aws_publish_us_secret_key))
530-
GREP_PATTERN: grep -v 'gov-\|cn-'
531-
- file: bosh-stemcells-ci/ci/tasks/light-aws/tag-aws-ami-light.yml
532-
image: bosh-ecosystem-concourse-registry-image
533-
task: tag-gov-published-aws-ami-light-stemcells
534-
params:
535-
AWS_PAGER:
536-
AWS_ACCESS_KEY_ID: ((aws_publish_us-gov_access_key))
537-
AWS_SECRET_ACCESS_KEY: ((aws_publish_us-gov_secret_key))
538-
GREP_PATTERN: grep 'gov-'
539-
#! - file: bosh-stemcells-ci/ci/tasks/light-aws/tag-aws-ami-light.yml
540-
#! task: tag-china-published-aws-ami-light-stemcells
541-
#! params:
542-
#! AWS_ACCESS_KEY_ID: ((aws_publish_cn_access_key))
543-
#! AWS_SECRET_ACCESS_KEY: ((aws_publish_cn_secret_key))
544-
#! GREP_PATTERN: grep 'cn-'
470+
- in_parallel:
471+
- in_parallel:
472+
- task: extract-warden-image
473+
image: bosh-integration-registry-image
474+
config:
475+
inputs:
476+
- name: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
477+
outputs:
478+
- name: stemcell-image
479+
platform: linux
480+
run:
481+
dir: stemcell-image
482+
path: /bin/bash
483+
args:
484+
- -ce
485+
- |
486+
tar xvf ../candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/bosh-stemcell-*-warden-boshlite-(@= data.values.stemcell_details.os_name @)*.tgz image
487+
printf 'FROM scratch\nADD image /\n' > Dockerfile
488+
- task: build-stemcell-oci-image
489+
privileged: true
490+
config:
491+
platform: linux
492+
image_resource:
493+
type: registry-image
494+
source:
495+
repository: concourse/oci-build-task
496+
inputs:
497+
- name: stemcell-image
498+
outputs:
499+
- name: image
500+
params:
501+
CONTEXT: stemcell-image
502+
run:
503+
path: build
504+
- put: github-container-registry-(@= data.values.stemcell_details.os_name @)-stemcell
505+
params:
506+
image: image/image.tar
507+
additional_tags: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
508+
- put: published-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
509+
params:
510+
files:
511+
- candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
512+
options:
513+
author_email: *ci_bot_email
514+
author_name: *ci_bot_name
515+
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
516+
rename: '{{.Version}}/stemcells.meta4'
517+
version: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
518+
#@ if len(data.values.stemcell_details.include_fips_iaas) > 0 :
519+
- put: published-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)
520+
params:
521+
files:
522+
- candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
523+
options:
524+
author_email: *ci_bot_email
525+
author_name: *ci_bot_name
526+
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)-fips/(@= str(data.values.stemcell_details.major_version) @).x'
527+
rename: '{{.Version}}/stemcells.meta4'
528+
version: candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
529+
#@ end
530+
- params:
531+
files:
532+
- candidate-aws-light-stemcell/*.tgz
533+
options:
534+
author_email: *ci_bot_email
535+
author_name: *ci_bot_name
536+
message: 'publish (light aws): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
537+
rename: '{{.Version}}/stemcells.aws.meta4'
538+
version: candidate-aws-light-stemcell/.resource/version
539+
put: published-aws-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
540+
541+
#! once we release all regions with the same account, we can unify these again
542+
- file: bosh-stemcells-ci/ci/tasks/light-aws/tag-aws-ami-light.yml
543+
image: bosh-ecosystem-concourse-registry-image
544+
task: tag-published-aws-ami-light-stemcells
545+
params:
546+
AWS_PAGER:
547+
AWS_ACCESS_KEY_ID: ((aws_publish_us_access_key))
548+
AWS_SECRET_ACCESS_KEY: ((aws_publish_us_secret_key))
549+
GREP_PATTERN: grep -v 'gov-\|cn-'
550+
- file: bosh-stemcells-ci/ci/tasks/light-aws/tag-aws-ami-light.yml
551+
image: bosh-ecosystem-concourse-registry-image
552+
task: tag-gov-published-aws-ami-light-stemcells
553+
params:
554+
AWS_PAGER:
555+
AWS_ACCESS_KEY_ID: ((aws_publish_us-gov_access_key))
556+
AWS_SECRET_ACCESS_KEY: ((aws_publish_us-gov_secret_key))
557+
GREP_PATTERN: grep 'gov-'
558+
#! - file: bosh-stemcells-ci/ci/tasks/light-aws/tag-aws-ami-light.yml
559+
#! task: tag-china-published-aws-ami-light-stemcells
560+
#! params:
561+
#! AWS_ACCESS_KEY_ID: ((aws_publish_cn_access_key))
562+
#! AWS_SECRET_ACCESS_KEY: ((aws_publish_cn_secret_key))
563+
#! GREP_PATTERN: grep 'cn-'
545564
- params:
546565
files:
547566
- candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
@@ -838,11 +857,12 @@ resources:
838857
#@ end
839858

840859
- name: github-container-registry-(@= data.values.stemcell_details.os_name @)-stemcell
841-
type: docker-image
860+
type: registry-image
842861
source:
843862
repository: ghcr.io/cloudfoundry/(@= data.values.stemcell_details.os_name @)-stemcell
844863
username: ((github_read_write_packages.username))
845864
password: ((github_read_write_packages.password))
865+
tag: latest
846866

847867
- name: bosh-integration-registry-image
848868
type: registry-image

0 commit comments

Comments
 (0)