Skip to content

Commit

Permalink
Add download/push scripts for Ubuntu RTOS EKS-A image
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna committed Apr 18, 2024
1 parent 6207b18 commit 0402ea1
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 0 deletions.
56 changes: 56 additions & 0 deletions projects/canonical/ubuntu/Help.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@



########### DO NOT EDIT #############################
# To update call: make add-generated-help-block
# This is added to help document dynamic targets and support shell autocompletion


##@ GIT/Repo Targets
clone-repo: ## Clone upstream `ubuntu`
checkout-repo: ## Checkout upstream tag based on value in GIT_TAG file

##@ Run in Docker Targets
run-in-docker/all-attributions: ## Run `all-attributions` in docker builder container
run-in-docker/all-attributions-checksums: ## Run `all-attributions-checksums` in docker builder container
run-in-docker/all-checksums: ## Run `all-checksums` in docker builder container
run-in-docker/attribution: ## Run `attribution` in docker builder container
run-in-docker/attribution-checksums: ## Run `attribution-checksums` in docker builder container
run-in-docker/binaries: ## Run `binaries` in docker builder container
run-in-docker/checksums: ## Run `checksums` in docker builder container
run-in-docker/clean: ## Run `clean` in docker builder container
run-in-docker/clean-go-cache: ## Run `clean-go-cache` in docker builder container
run-in-docker/validate-checksums: ## Run `validate-checksums` in docker builder container

##@ Artifact Targets
tarballs: ## Create tarballs by calling build/lib/simple_create_tarballs.sh unless SIMPLE_CREATE_TARBALLS=false, then tarballs must be defined in project Makefile
s3-artifacts: # Prepare ARTIFACTS_PATH folder structure with tarballs/manifests/other items to be uploaded to s3
upload-artifacts: # Upload tarballs and other artifacts from ARTIFACTS_PATH to S3

##@ Clean Targets
clean: ## Removes source and _output directory
clean-go-cache: ## Removes the GOMODCACHE AND GOCACHE folders
clean-repo: ## Removes source directory

##@Fetch Binary Targets
handle-dependencies: ## Download and extract TARs for each dependency listed in PROJECT_DEPENDENCIES

##@ Helpers
help: ## Display this help
add-generated-help-block: ## Add or update generated help block to document project make file and support shell auto completion

##@Update Helpers
start-docker-builder: ## Start long lived builder base docker container
stop-docker-builder: ## Clean up builder base docker container
run-buildkit-and-registry: ## Run buildkitd and a local docker registry as containers
stop-buildkit-and-registry: ## Stop the buildkitd and a local docker registry containers
generate: ## Update UPSTREAM_PROJECTS.yaml
update-go-mods: ## Update locally checked-in go sum to assist in vuln scanning
update-vendor-for-dep-patch: ## After bumping dep in go.mod file, uses generic vendor update script or one provided from upstream project
patch-for-dep-update: ## After bumping dep in go.mod file and updating vendor, generates patch
create-ecr-repos: ## Create repos in ECR for project images for local testing

##@ Build Targets
build: ## Called via prow presubmit, calls `upload-artifacts`
release: ## Called via prow postsubmit + release jobs, calls `upload-artifacts`
########### END GENERATED ###########################
36 changes: 36 additions & 0 deletions projects/canonical/ubuntu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
BASE_DIRECTORY:=$(abspath ../../../)
GIT_TAG=non-existent

REPO=ubuntu
REPO_OWNER=canonical
RTOS_BUCKET_NAME?=
RTOS_IMAGE_DATE=$(shell cat RTOS_IMAGE_DATE)
RELEASE_BRANCH=1-29
RTOS_SOURCE_URL=https://$(RTOS_BUCKET_NAME).s3.us-west-2.amazonaws.com/ubuntu/jammy/$(RTOS_IMAGE_DATE)/ubuntu-jammy-eks-anywhere-pro-realtime-minimal-amd64-eks-anywhere-$(RELEASE_BRANCH)-pro-realtime.raw.gz

HAS_S3_ARTIFACTS=true
SIMPLE_CREATE_BINARIES=false
SIMPLE_CREATE_TARBALLS=false
HAS_LICENSES=false
IMAGE_NAMES=
EXCLUDE_FROM_CHECKSUMS_BUILDSPEC=true
EXCLUDE_FROM_UPGRADE_BUILDSPEC=true

BUILD_TARGETS=upload-artifacts
RELEASE_TARGETS=upload-artifacts

include $(BASE_DIRECTORY)/Common.mk

s3-artifacts: download-rtos-image

.PHONY: download-rtos-image
download-rtos-image:
build/download_rtos_image.sh $(RTOS_SOURCE_URL) $(ARTIFACTS_PATH)


########### DO NOT EDIT #############################
# To update call: make add-generated-help-block
# This is added to help document dynamic targets and support shell autocompletion
# Run make help for a formatted help block with all targets
include Help.mk
########### END GENERATED ###########################
1 change: 1 addition & 0 deletions projects/canonical/ubuntu/RTOS_IMAGE_DATE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20240414
30 changes: 30 additions & 0 deletions projects/canonical/ubuntu/build/download_rtos_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


set -x
set -o errexit
set -o pipefail

RTOS_SOURCE_URL="${1?Specify first argument - source URL for the Ubuntu RTOS image}"
ARTIFACTS_PATH="${2?Specify second argument - artifacts path}"

function build::download::ubuntu::rtos::image(){
mkdir -p $ARTIFACTS_PATH
filename=$(basename $RTOS_SOURCE_URL)
curl -s $RTOS_SOURCE_URL -o $ARTIFACTS_PATH/ubuntu.gz
}

build::download::ubuntu::rtos::image
9 changes: 9 additions & 0 deletions projects/canonical/ubuntu/expected_artifacts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SHA256SUM
SHA256SUM.sha256
SHA256SUM.sha512
SHA512SUM
SHA512SUM.sha256
SHA512SUM.sha512
ubuntu.gz
ubuntu.gz.sha256
ubuntu.gz.sha512
7 changes: 7 additions & 0 deletions release/staging-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ batch:
variables:
PROJECT_PATH: projects/brancz/kube-rbac-proxy
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/brancz.kube-rbac-proxy
- identifier: canonical_ubuntu
env:
type: ARM_CONTAINER
compute-type: BUILD_GENERAL1_SMALL
variables:
PROJECT_PATH: projects/canonical/ubuntu
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/canonical.ubuntu
- identifier: cert_manager_cert_manager
env:
type: ARM_CONTAINER
Expand Down

0 comments on commit 0402ea1

Please sign in to comment.