Skip to content

Commit

Permalink
Support GCP's new Arm architecture (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov authored Aug 23, 2022
1 parent 73fbafe commit d5befd1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
1 change: 1 addition & 0 deletions docs/guide/custom-vms.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ compute_engine_instance:
image_project: cirrus-images # GCP project.
image: family/docker-kvm # family or a full image name.
platform: linux
architecture: arm64 # optional. By default, amd64 is assumed.
cpu: 4 # optional. Defaults to 2 CPUs.
memory: 16G # optional. Defaults to 4G.
disk: 100 # optional. By default, uses the smallest disk size required by the image.
Expand Down
53 changes: 39 additions & 14 deletions docs/guide/docker-builder-vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
In essence, a `docker_builder` is basically [a `task`](writing-tasks.md) that is executed in a VM with pre-installed Docker.
A `docker_builder` can be defined the same way as a `task`:

```yaml
docker_builder:
build_script: docker build --tag myrepo/foo:latest .
```
=== "amd64"

```yaml
docker_builder:
build_script: docker build --tag myrepo/foo:latest .
```

=== "arm64"

```yaml
docker_builder:
env:
CIRRUS_ARCH: arm64
build_script: docker build --tag myrepo/foo:latest .
```

Leveraging features such as [Task Dependencies](writing-tasks.md#depepndencies), [Conditional Execution](writing-tasks.md#conditional-execution)
and [Encrypted Variables](writing-tasks.md#encrypted-variables) with a Docker Builder can help building relatively
Expand Down Expand Up @@ -56,7 +67,6 @@ For your convenience, a Docker Builder VM has some common packages pre-installed

* AWS CLI
* Docker Compose
* Heroku CLI
* OpenJDK 11
* Python
* Ruby with Bundler
Expand All @@ -66,15 +76,30 @@ For your convenience, a Docker Builder VM has some common packages pre-installed
Under the hood a simple integration with [Google Compute Engine](supported-computing-services.md#compute-engine)
is used and basically `docker_builder` is a syntactic sugar for the following [`compute_engine_instance`](custom-vms.md) configuration:

```yaml
task:
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 4
memory: 16G
```
=== "amd64"

```yaml
task:
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 4
memory: 16G
```

=== "arm64"

```yaml
task:
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
memory: 16G
```

You can check Packer templates of the VM image in [`cirruslabs/vm-images` repository](https://github.com/cirruslabs/vm-images).

Expand Down
6 changes: 4 additions & 2 deletions docs/guide/supported-computing-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ like this:
```yaml
gce_instance:
image_project: ubuntu-os-cloud
image_name: ubuntu-1904-disco-v20190417
image_name: ubuntu-2204-jammy-arm64-v20220712a
architecture: arm64 # optional. By default, amd64 is assumed.
zone: us-central1-a
cpu: 8
memory: 40GB
Expand Down Expand Up @@ -297,7 +298,8 @@ task:
```yaml
gce_instance:
image_project: ubuntu-os-cloud
image_family: ubuntu-1904
image_family: ubuntu-2204-lts-arm64
architecture: arm64
```

#### Custom VM images
Expand Down

0 comments on commit d5befd1

Please sign in to comment.