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

Clean up local yawollet image build #409

Merged
merged 5 commits into from
Sep 10, 2024
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
10 changes: 7 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ validate-yawollet-image:
build-yawollet-image:
FROM +packer

ARG USEROS
ARG USERARCH
ARG TARGETOS
ARG TARGETARCH

ARG MACHINE_FLAVOR=c1.2
ARG VOLUME_TYPE=storage_premium_perf6
Expand All @@ -127,7 +127,7 @@ build-yawollet-image:

COPY +get-envoy/envoy out/envoy/envoy
COPY +get-envoy/envoylibs out/envoy/lib
COPY (+build/controller --CONTROLLER=yawollet --GOOS=$USEROS --GOARCH=$USERARCH) out/yawollet
COPY (+build/controller --CONTROLLER=yawollet --GOOS=$TARGETOS --GOARCH=$TARGETARCH) out/yawollet
COPY +set-version/VERSION .

COPY image image
Expand Down Expand Up @@ -337,6 +337,10 @@ golangci-lint:

packer:
FROM hashicorp/packer:$PACKER_VERSION

# set this env var to get higher GitHub API requests
ARG PACKER_GITHUB_API_TOKEN

RUN packer plugins install github.com/hashicorp/openstack
RUN apk add ansible
RUN apk add openssh-client
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ earthly +destroy-packer-environment \
Before running our `Earthly` targets, set the needed environment variables:

```shell
export OS_NETWORK_ID=<from your openstack environment>
export OS_FLOATING_NETWORK_ID=<from your openstack environment>
export OS_SECURITY_GROUP_ID=<from your openstack environment>
# set OS_NETWORK_ID, OS_FLOATING_NETWORK_ID, OS_SECURITY_GROUP_ID from terraform state
source <(jq -r '.outputs | del(.OS_SOURCE_IMAGE) | keys[] as $k | "export \($k)=\(.[$k].value)"' hack/packer-infrastructure/terraform.tfstate)
export OS_SOURCE_IMAGE=<from your openstack environment>
export IMAGE_VISIBILITY=<private or public>
```
Expand All @@ -103,7 +102,7 @@ earthly +validate-yawollet-image
```

```shell
earthly +build-yawollet-image \
earthly --platform=linux/amd64 +build-yawollet-image \
--OS_NETWORK_ID="$OS_NETWORK_ID" \
--OS_FLOATING_NETWORK_ID="$OS_FLOATING_NETWORK_ID" \
--OS_SECURITY_GROUP_ID="$OS_SECURITY_GROUP_ID" \
Expand Down
8 changes: 1 addition & 7 deletions hack/packer-infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ terraform {
source = "terraform-provider-openstack/openstack"
version = ">= 1.47"
}
template = {
source = "hashicorp/template"
version = "2.2.0"
}
}
}

provider "openstack" {
use_octavia = false
}
provider "openstack" {}