diff --git a/.github/workflows/podvm_mkosi_image.yaml b/.github/workflows/podvm_mkosi_image.yaml index 356b71ce4..44436e89b 100644 --- a/.github/workflows/podvm_mkosi_image.yaml +++ b/.github/workflows/podvm_mkosi_image.yaml @@ -3,10 +3,6 @@ name: mkosi build podvm builder, binaries and image on: workflow_dispatch: -defaults: - run: - working-directory: src/cloud-api-adaptor/podvm-mkosi - jobs: build-podvm-image-mkosi: name: Build podvm image via mkosi @@ -41,9 +37,11 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build builder + working-directory: src/cloud-api-adaptor/podvm-mkosi run: make fedora-binaries-builder - name: Build binaries + working-directory: src/cloud-api-adaptor/podvm-mkosi run: make binaries # TODO - build image via mkosi when s390x is available diff --git a/src/cloud-api-adaptor/aws/README.md b/src/cloud-api-adaptor/aws/README.md index 0c23fe7aa..44cb85f0e 100644 --- a/src/cloud-api-adaptor/aws/README.md +++ b/src/cloud-api-adaptor/aws/README.md @@ -83,7 +83,7 @@ echo ${PODVM_AMI_ID} ## Build CAA container image -> **Note**: If you have made changes to the CAA code and you want to deploy those changes then follow [these instructions](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/install/README.md#building-custom-cloud-api-adaptor-image) to build the container image from the root of this repository. +> **Note**: If you have made changes to the CAA code and you want to deploy those changes then follow [these instructions](../install/README.md#building-custom-cloud-api-adaptor-image) to build the container image from the root of this repository. If you would like to deploy the latest code from the default branch (`main`) of this repository then expose the following environment variable: diff --git a/src/cloud-api-adaptor/docs/addnewprovider.md b/src/cloud-api-adaptor/docs/addnewprovider.md index b3994cca6..f2da7b9e6 100644 --- a/src/cloud-api-adaptor/docs/addnewprovider.md +++ b/src/cloud-api-adaptor/docs/addnewprovider.md @@ -2,15 +2,15 @@ ### Step 1: Initialize and register the cloud provider manager -The provider-specific cloud manager should be placed under `pkg/adaptor/cloud//`. +The provider-specific cloud manager should be placed under `src/cloud-providers/`. -:information_source:[Example code](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/pkg/adaptor/cloud/aws) +:information_source:[Example code](../../cloud-providers/aws) ### Step 2: Add provider specific code -Under `pkg/adaptor/cloud/`, start by adding a new file called `types.go`. This file defines a configuration struct that contains the required parameters for a cloud provider. +Under `src/cloud-providers/`, start by adding a new file called `types.go`. This file defines a configuration struct that contains the required parameters for a cloud provider. -:information_source:[Example code](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/pkg/adaptor/cloud/aws/types.go) +:information_source:[Example code](../../cloud-providers/aws/types.go) #### Step 2.1: Implement the Cloud interface @@ -28,7 +28,7 @@ func init() { } ``` -:information_source:[Example code](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/pkg/adaptor/cloud/aws/manager.go) +:information_source:[Example code](../../cloud-providers/aws/manager.go) #### Step 2.2: Implement the Provider interface @@ -38,7 +38,7 @@ The Provider interface defines a set of methods that need to be implemented by t - DeleteInstance - Teardown -:information_source:[Example code](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/pkg/adaptor/cloud/aws/provider.go#L76-L175) +:information_source:[Example code](../../cloud-providers/aws/provider.go) Also, consider adding additional files to modularize the code. You can refer to existing providers such as `aws`, `azure`, `ibmcloud`, and `libvirt` for guidance. Adding unit tests wherever necessary is good practice. @@ -46,12 +46,12 @@ Also, consider adding additional files to modularize the code. You can refer to To include your provider you need reference it from the main package. Go build tags are used to selectively include different providers. -:information_source:[Example code](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/cmd/cloud-api-adaptor/aws.go) +:information_source:[Example code](../../cloud-api-adaptor/cmd/cloud-api-adaptor/aws.go) ```go //go:build aws ``` -Note the comment at the top of the file, when building ensure `-tags=` is set to include your new provider. See the [Makefile](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/Makefile#L26) for more context and usage. +Note the comment at the top of the file, when building ensure `-tags=` is set to include your new provider. See the [Makefile](../../cloud-api-adaptor/Makefile#L26) for more context and usage. #### Step 3: Add documentation on how to build a Pod VM image diff --git a/src/cloud-api-adaptor/podvm-mkosi/Makefile b/src/cloud-api-adaptor/podvm-mkosi/Makefile index 470b1c55e..750c00996 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/Makefile +++ b/src/cloud-api-adaptor/podvm-mkosi/Makefile @@ -33,12 +33,14 @@ binaries: docker buildx use default @echo "Building binaries..." rm -rf ./resources/binaries-tree + cp -rf ../../../.git ../../.git docker buildx build \ --build-arg BUILDER_IMG=$(BUILDER) \ --build-arg AA_KBC=$(AA_KBC) \ $(if $(DEFAULT_AGENT_POLICY_FILE),--build-arg DEFAULT_AGENT_POLICY_FILE=$(DEFAULT_AGENT_POLICY_FILE),) \ -o type=local,dest="./resources/binaries-tree" \ - -f ../podvm/Dockerfile.podvm_binaries.fedora ../. + -f ../podvm/Dockerfile.podvm_binaries.fedora ../../ + rm -rf ../../.git PHONY: image image: diff --git a/src/cloud-api-adaptor/test/e2e/README.md b/src/cloud-api-adaptor/test/e2e/README.md index 3c12a0371..c767602ff 100644 --- a/src/cloud-api-adaptor/test/e2e/README.md +++ b/src/cloud-api-adaptor/test/e2e/README.md @@ -72,7 +72,7 @@ Use the properties on the table below for AWS: |vxlan_port|VXLAN port number|| >Notes: - * The AWS credentials are obtained from the CLI [configuration files](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). **Important**: the access key and secret are recorded in plain-text in [install/overlays/aws/kustomization.yaml](https://github.com/confidential-containers/cloud-api-adaptor/tree/main/install/overlays/aws/kustomization.yaml) + * The AWS credentials are obtained from the CLI [configuration files](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). **Important**: the access key and secret are recorded in plain-text in [install/overlays/aws/kustomization.yaml](../../install/overlays/aws/kustomization.yaml) * The subnet is created with CIDR IPv4 block 10.0.0.0/25. In case of deploying an EKS cluster, a secondary (private) subnet is created with CIDR IPv4 block 10.0.0.128/25 * The cluster type **onprem** assumes Kubernetes is already provisioned and its kubeconfig file path can be found at the `KUBECONFIG` environment variable or in the `~/.kube/config` file. Whereas **eks** type instructs to create an [AWS EKS](https://aws.amazon.com/eks/) cluster on the VPC