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

chore(make): reorg build targets and add Azure #297

Merged
merged 7 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
364 changes: 8 additions & 356 deletions Makefile

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions cmd/konvoy-image/cmd/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ func addAmazonArgs(fs *flag.FlagSet, amazonArgs *app.AmazonArgs) {
"",
"instance type used to build the AMI; the type must be present in the region in which the AMI is built",
)
_ = fs.MarkDeprecated("aws-instance-type", "please use `--instance-type`.")
fs.StringVar(
&amazonArgs.AWSInstanceType,
"instance-type",
"",
"instance type used to build the AMI; the type must be present in the region in which the AMI is built",
)
fs.StringArrayVar(
&amazonArgs.AMIUsers,
"ami-users",
Expand Down
7 changes: 7 additions & 0 deletions cmd/konvoy-image/cmd/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,11 @@ func addAzureArgs(fs *flag.FlagSet, azure *app.AzureArgs) {
"",
"the tenant id to use for the build",
)

fs.StringVar(
&azure.InstanceType,
"instance-type",
"Standard_D2ds_v5",
"the Instance Type to use for the build",
)
}
2 changes: 1 addition & 1 deletion docs/cli/konvoy-image_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ konvoy-image build <image.yaml> [flags]
--ami-groups stringArray a list of AWS groups which are allowed use the image, using 'all' result in a public image
--ami-regions stringArray a list of regions to publish amis
--ami-users stringArray a list AWS user accounts which are allowed use the image
--aws-instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--containerd-version string the version of containerd to install
--dry-run do not create artifacts, or delete them after creating. Recommended for tests.
--extra-vars strings flag passed Ansible's extra-vars
-h, --help help for build
--instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--kubernetes-version string The version of kubernetes to install. Example: 1.21.6
--overrides strings a comma separated list of override YAML files
--packer-manifest string provide the path to a custom packer manifest
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/konvoy-image_build_aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ aws --region us-west-2 --source-ami=ami-12345abcdef images/ami/centos-7.yaml
--ami-groups stringArray a list of AWS groups which are allowed use the image, using 'all' result in a public image
--ami-regions stringArray a list of regions to publish amis
--ami-users stringArray a list AWS user accounts which are allowed use the image
--aws-instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--containerd-version string the version of containerd to install
--dry-run do not create artifacts, or delete them after creating. Recommended for tests.
--extra-vars strings flag passed Ansible's extra-vars
-h, --help help for aws
--instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--kubernetes-version string The version of kubernetes to install. Example: 1.21.6
--overrides strings a comma separated list of override YAML files
--packer-manifest string provide the path to a custom packer manifest
Expand Down
1 change: 1 addition & 0 deletions docs/cli/konvoy-image_build_azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ azure --location westus2 --subscription-id <sub_id> images/azure/centos-7.yaml
--gallery-image-sku string the gallery image sku to set
--gallery-name string the gallery name to publish the image in (default "dkp")
-h, --help help for azure
--instance-type string the Instance Type to use for the build (default "Standard_D2ds_v5")
--kubernetes-version string The version of kubernetes to install. Example: 1.21.6
--location string the location in which to build the image (default "westus2")
--overrides strings a comma separated list of override YAML files
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/konvoy-image_generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ konvoy-image generate <image.yaml> [flags]
--ami-groups stringArray a list of AWS groups which are allowed use the image, using 'all' result in a public image
--ami-regions stringArray a list of regions to publish amis
--ami-users stringArray a list AWS user accounts which are allowed use the image
--aws-instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--containerd-version string the version of containerd to install
--extra-vars strings flag passed Ansible's extra-vars
-h, --help help for generate
--instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--kubernetes-version string The version of kubernetes to install. Example: 1.21.6
--overrides strings a comma separated list of override YAML files
--region string the region in which to build the AMI
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/konvoy-image_generate_aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ aws --region us-west-2 --source-ami=ami-12345abcdef images/ami/centos-7.yaml
--ami-groups stringArray a list of AWS groups which are allowed use the image, using 'all' result in a public image
--ami-regions stringArray a list of regions to publish amis
--ami-users stringArray a list AWS user accounts which are allowed use the image
--aws-instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--containerd-version string the version of containerd to install
--extra-vars strings flag passed Ansible's extra-vars
-h, --help help for aws
--instance-type string instance type used to build the AMI; the type must be present in the region in which the AMI is built
--kubernetes-version string The version of kubernetes to install. Example: 1.21.6
--overrides strings a comma separated list of override YAML files
--region string the region in which to build the AMI
Expand Down
1 change: 1 addition & 0 deletions docs/cli/konvoy-image_generate_azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ azure --location westus2 --subscription-id <sub_id> images/azure/centos-7.yaml
--gallery-image-sku string the gallery image sku to set
--gallery-name string the gallery name to publish the image in (default "dkp")
-h, --help help for azure
--instance-type string the Instance Type to use for the build (default "Standard_D2ds_v5")
--kubernetes-version string The version of kubernetes to install. Example: 1.21.6
--location string the location in which to build the image (default "westus2")
--overrides strings a comma separated list of override YAML files
Expand Down
2 changes: 1 addition & 1 deletion images/azure/rhel-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ packer:
image_version: "latest"
ssh_username: "azureuser"

build_name: "rhel-7"
build_name: "rhel-8"
packer_builder_type: "azure"
python_path: ""
94 changes: 94 additions & 0 deletions make/ci.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#
# CI targets
#

# requires ANSIBLE_PATH, otherwise run `make ci.e2e.ansible`
e2e.ansible:
make -C test/e2e/ansible e2e

ifeq ($(CI), true)
export DOCKER_DEVKIT_AWS_ARGS := --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY
endif

# Run every E2E test in its own devkit container.
# All tests run in parallel. Adjust parallelism with --jobs.
# Output is interleaved when run in parallel. Use --output-sync=recurse to serialize output.
ci.e2e.build.all: ci.e2e.build.centos-7
ci.e2e.build.all: ci.e2e.build.ubuntu-18
ci.e2e.build.all: ci.e2e.build.ubuntu-20
ci.e2e.build.all: ci.e2e.build.sles-15
ci.e2e.build.all: ci.e2e.build.oracle-7
ci.e2e.build.all: ci.e2e.build.oracle-8
ci.e2e.build.all: ci.e2e.build.flatcar
ci.e2e.build.all: e2e.build.centos-7-offline
ci.e2e.build.all: e2e.build.rhel-7.9-offline-fips
ci.e2e.build.all: e2e.build.rhel-8.2-offline-fips
ci.e2e.build.all: e2e.build.rhel-8.4-offline-fips
ci.e2e.build.all: ci.e2e.build.rhel-8-fips
ci.e2e.build.all: ci.e2e.build.centos-7-nvidia
ci.e2e.build.all: ci.e2e.build.sles-15-nvidia
ci.e2e.build.all: ci.e2e.build.rhel-8.4-ova
ci.e2e.build.all: ci.e2e.build.rhel-7.9-ova

# Run an E2E test in its own devkit container.
ci.e2e.build.%:
make devkit.run WHAT="make e2e.build.$*"

# AWS
e2e.build.centos-7: centos7

e2e.build.centos-7-offline: centos7-offline infra.aws.destroy

e2e.build.rhel-7.9-offline-fips: rhel79-fips-offline infra.aws.destroy

e2e.build.rhel-8.2-offline-fips: rhel82-fips-offline infra.aws.destroy

e2e.build.rhel-8.4-offline-fips: rhel84-fips-offline infra.aws.destroy

e2e.build.ubuntu-18: ubuntu18

e2e.build.ubuntu-20: ubuntu20

e2e.build.sles-15: sles15

e2e.build.oracle-7: oracle7

e2e.build.oracle-8: oracle8

e2e.build.flatcar: flatcar

e2e.build.centos-7-nvidia: centos7-nvidia

e2e.build.sles-15-nvidia: sles15-nvidia

e2e.build.rhel-8-fips: rhel82-fips

# Azure
e2e.build.centos-7-azure: centos7-azure

e2e.build.flatcar-azure: flatcar-azure

e2e.build.oracle-7-azure: oracle7-azure

e2e.build.oracle-8-azure: oracle8-azure

e2e.build.sles-15-azure: sles15-azure

e2e.build.rhel-7-fips-azure: rhel7-fips-azure

e2e.build.rhel-8-fips-azure: rhel8-fips-azure

e2e.build.ubuntu-18-azure: ubuntu18-azure

e2e.build.ubuntu-20-azure: ubuntu20-azure

# vSphere
e2e.build.rhel-8.4-ova: rhel84-ova

e2e.build.rhel-7.9-ova: rhel79-ova

# use sibling containers to handle dependencies and avoid DinD
ci.e2e.ansible:
make -C test/e2e/ansible e2e.setup
WHAT="make -C test/e2e/ansible e2e.run" DOCKER_DEVKIT_DEFAULT_ARGS="--rm --net=host" make devkit.run
make -C test/e2e/ansible e2e.clean
Loading