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

Codegen aws-sdk-go-v2 clients #4406

Merged
merged 3 commits into from
Nov 11, 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
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ gogenerate-init:
PATH=$(PATH):$(shell pwd)/scripts go generate -x ./ecs-init/...
$(MAKE) goimports

AWS_SDK_CODEGEN_IMAGE="amazon/aws-sdk-go-codegen"
gogenerate-aws-sdk:
@docker build --build-arg GO_VERSION=${GO_VERSION} -t $(AWS_SDK_CODEGEN_IMAGE) aws-sdk-go-v2
@docker run \
--volume "$(PWD)/aws-sdk-go-v2/aws-models:/go/src/github.com/aws/aws-sdk-go-v2/codegen/sdk-codegen/aws-models" \
--volume "$(PWD)/aws-sdk-go-v2/service:/go/src/github.com/aws/aws-sdk-go-v2/service" \
--rm \
$(AWS_SDK_CODEGEN_IMAGE)

# 'go' may not be on the $PATH for sudo tests
GO_EXECUTABLE=$(shell command -v go 2> /dev/null)

Expand Down Expand Up @@ -506,8 +515,7 @@ clean-all: clean
# for our dockerfree builds, we likely don't have docker
# ensure docker is running and we can talk to it, abort if not:
docker ps > /dev/null
-docker rmi $(BUILDER_IMAGE) "amazon/amazon-ecs-agent-cleanbuild:make"
-docker rmi $(BUILDER_IMAGE) "amazon/amazon-ecs-agent-cleanbuild-windows:make"
-docker rmi $(BUILDER_IMAGE) "amazon/amazon-ecs-agent-cleanbuild:make" "amazon/amazon-ecs-agent-cleanbuild-windows:make" $(AWS_SDK_CODEGEN_IMAGE)
-$(MAKE) -C misc/netkitten $(MFLAGS) clean
-$(MAKE) -C misc/volumes-test $(MFLAGS) clean
-$(MAKE) -C misc/exec-command-agent-test $(MFLAGS) clean
Expand Down
42 changes: 42 additions & 0 deletions aws-sdk-go-v2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file 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.

ARG GO_VERSION
FROM public.ecr.aws/docker/library/golang:${GO_VERSION}
sparrc marked this conversation as resolved.
Show resolved Hide resolved

ENV XDG_CACHE_HOME /tmp

RUN go env -w GOPROXY=direct

# Install Amazon Coretto for OpenJDK 23.
# https://docs.aws.amazon.com/corretto/latest/corretto-23-ug/generic-linux-install.html
RUN wget -O - https://apt.corretto.aws/corretto.key | \
gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | \
tee /etc/apt/sources.list.d/corretto.list

RUN apt-get update && \
apt-get install -y --no-install-recommends java-23-amazon-corretto-jdk

RUN mkdir -p /go/src/github.com/aws/

RUN git clone https://github.com/aws/aws-sdk-go-v2.git /go/src/github.com/aws/aws-sdk-go-v2

WORKDIR /go/src/github.com/aws/aws-sdk-go-v2

# Remove test codegen directories to speed up the SDK codegen process.
RUN rm -r codegen/protocol-test-codegen codegen/smithy-aws-go-codegen/src/test

RUN make smithy-go-publish-local

CMD ["make", "smithy-generate", "update-requires", "update-module-metadata", "min-go-version-service_.", "tidy-modules-service_."]
Loading
Loading