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

Merge main branch code in base-images branch to create new base images. #444

Merged
merged 4 commits into from
Dec 14, 2023
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazonlinux:2.0.20230307.0 as base
FROM amazonlinux:2023.2.20231113.0 as base

ARG OPENSSL_VERSION=3.0.8

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/amazonlinux/amazonlinux:2.0.20230307.0
FROM public.ecr.aws/amazonlinux/amazonlinux:2023.2.20231113.0

ARG OPENSSL_VERSION=3.0.8

Expand All @@ -16,6 +16,8 @@ RUN yum -y update && yum -y install \
perl \
softhsm \
tar \
perl-IPC-Cmd \
perl-Pod-Html \
wget


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ RUN yum -y update && yum -y install \
make \
perl \
tar \
perl-IPC-Cmd \
perl-Pod-Html \
wget


Expand Down
20 changes: 20 additions & 0 deletions .github/docker-images/integration-tests/amazonlinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ ARG BASE_IMAGE
ARG PRE_RELEASE_IMAGE
FROM ${BASE_IMAGE} AS build_integration_tests

###############################################################################
# Install pre-built CMake
###############################################################################
WORKDIR /tmp
RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0.tar.gz -o cmake-3.28.0.tar.gz \
&& tar -zxvf cmake-3.28.0.tar.gz \
&& cd cmake-3.28.0 \
&& ./bootstrap \
&& make -j 2 \
&& make install

###############################################################################
# Install Prerequisites
###############################################################################

RUN yum -y update && yum -y install \
autoconf \
libtool \
Expand All @@ -14,10 +29,15 @@ RUN mkdir -p /root/integration-tests/build \
&& cmake .. -DCMAKE_BUILD_TYPE=DEBUG \
&& cmake --build . --target aws-iot-device-client-integration-tests

###############################################################################
# Actual docker image
###############################################################################

FROM ${PRE_RELEASE_IMAGE} AS runner

###############################################################################
# Install openssl for libssl dependency.
###############################################################################
RUN yum update -y && yum install -y libatomic libcurl-devel openssl-devel libuuid-devel wget && \
rm -rf /var/cache/yum && \
yum clean all
Expand Down
21 changes: 21 additions & 0 deletions .github/docker-images/integration-tests/ubi8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ ARG BASE_IMAGE
ARG PRE_RELEASE_IMAGE
FROM ${BASE_IMAGE} AS build_integration_tests

###############################################################################
# Install pre-built CMake
###############################################################################
WORKDIR /tmp
RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0.tar.gz -o cmake-3.28.0.tar.gz \
&& tar -zxvf cmake-3.28.0.tar.gz \
&& cd cmake-3.28.0 \
&& ./bootstrap \
&& make -j 2 \
&& make install

###############################################################################
# Install Prerequisites
###############################################################################

RUN #yum update -y && yum install -y libcurl-devel openssl-devel libuuid-devel make gcc gcc-c++ git zlib-devel

COPY ./integration-tests /root/integration-tests
Expand All @@ -10,10 +25,16 @@ RUN mkdir -p /root/integration-tests/build \
&& cmake .. -DCMAKE_BUILD_TYPE=DEBUG \
&& cmake --build . --target aws-iot-device-client-integration-tests

###############################################################################
# Actual docker image
###############################################################################

FROM ${PRE_RELEASE_IMAGE} AS runner

###############################################################################
# Install openssl for libssl dependency.
###############################################################################

RUN yum update -y && yum install -y libatomic libcurl-devel openssl-devel libuuid-devel wget && \
rm -rf /var/cache/yum && \
yum clean all
Expand Down
55 changes: 53 additions & 2 deletions .github/docker-images/integration-tests/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,58 @@ ARG BASE_IMAGE
ARG PRE_RELEASE_IMAGE
FROM ${OS} AS build_localproxy

ARG OPENSSL_VERSION=3.0.8

###############################################################################
# Install prereqs for CMake
###############################################################################
RUN apt-get update -qq \
&& apt-get -y install \
git \
clang-format \
curl \
build-essential \
wget \
libc6-dbg \
softhsm \
zlib1g-dev \
&& apt-get clean


###############################################################################
# Install OpenSSL 3.0.8
###############################################################################
WORKDIR /tmp
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& tar -zxvf openssl-${OPENSSL_VERSION}.tar.gz \
&& cd openssl-${OPENSSL_VERSION} \
&& ./config \
&& make \
&& make install \
&& ldconfig

###############################################################################
# Install pre-built CMake
###############################################################################
WORKDIR /tmp
RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0.tar.gz -o cmake-3.28.0.tar.gz \
&& tar -zxvf cmake-3.28.0.tar.gz \
&& cd cmake-3.28.0 \
&& ./bootstrap \
&& make -j 2 \
&& make install

###############################################################################
# Install Prerequisites
###############################################################################

RUN apt update && apt upgrade -y && \
apt install -y git libboost-all-dev autoconf automake \
wget libtool curl make g++ unzip cmake libssl-dev

###############################################################################
# Install Dependencies
###############################################################################

RUN mkdir /home/dependencies
WORKDIR /home/dependencies
Expand Down Expand Up @@ -74,16 +119,22 @@ RUN mkdir -p /root/integration-tests/build \
&& cmake .. -DCMAKE_BUILD_TYPE=DEBUG \
&& cmake --build . --target aws-iot-device-client-integration-tests

###############################################################################
# Actual docker image

###############################################################################

FROM ${BASE_IMAGE} AS runner
RUN apt-get update && apt-get install -y libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev wget ssh ca-certificates wget apt-utils

RUN mkdir -p /home/aws-iot-securetunneling-localproxy/certs && \
cd /home/aws-iot-securetunneling-localproxy/certs && \
wget https://www.amazontrust.com/repository/AmazonRootCA1.pem && \
wget --no-check-certificate https://www.amazontrust.com/repository/AmazonRootCA1.pem && \
openssl rehash ./
###############################################################################
# Copy the binaries from builder stages.
###############################################################################

# # Copy the binaries from builder stages.
COPY --from=build_localproxy /home/aws-iot-securetunneling-localproxy/localproxy /localproxy
COPY --from=build_integration_tests /root/integration-tests/build/aws-iot-device-client-integration-tests /aws-iot-device-client-integration-tests
COPY --from=build_integration_tests /root/integration-tests/source/tunneling/test-tunnel.sh /test-tunnel.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
file: .github/docker-images/Dockerfile
context: .
build-args: |
OS=amazonlinux:2022.0.20221207.4
OS=amazonlinux:2023.2.20231113.0
BASE_IMAGE=public.ecr.aws/${{ env.ECR_BASE_REPO }}:x86_64-amazonlinux-latest
push: true
tags: |
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
file: .github/docker-images/Dockerfile
context: .
build-args: |
OS=amazonlinux:2022.0.20221207.4
OS=amazonlinux:2023.2.20231113.0
BASE_IMAGE=public.ecr.aws/${{ env.ECR_BASE_REPO }}:aarch64-amazonlinux-latest
push: true
tags: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ jobs:
file: .github/docker-images/Dockerfile
context: .
build-args: |
OS=amazonlinux:latest
OS=amazonlinux:2023.2.20231113.0
BASE_IMAGE=public.ecr.aws/${{ env.ECR_BASE_REPO }}:x86_64-amazonlinux-latest
push: true
tags: |
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
file: .github/docker-images/Dockerfile
context: .
build-args: |
OS=amazonlinux:latest
OS=amazonlinux:2023.2.20231113.0
BASE_IMAGE=public.ecr.aws/${{ env.ECR_BASE_REPO }}:aarch64-amazonlinux-latest
push: true
tags: |
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13)
project(aws-iot-device-client-integration-tests)

set(OPENSSL_USE_STATIC_LIBS TRUE)
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/CMakeLists.txt.gtest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13)

project(googletest-download NONE)

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/CMakeLists.txt.libawscpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13)
project(aws-sdk-cpp NONE)
include(ExternalProject)

ExternalProject_Add(aws-sdk-cpp
GIT_REPOSITORY https://github.com/aws/aws-sdk-cpp.git
GIT_TAG 1.11.56
GIT_TAG 1.11.219
LIST_SEPARATOR "|"
CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF
-DBUILD_ONLY=iot|iotsecuretunneling
Expand Down
13 changes: 0 additions & 13 deletions integration-tests/source/GTestMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,6 @@ class GlobalEnvironment : public ::testing::Environment
{
public:
~GlobalEnvironment() override {}
// cppcheck-suppress unusedFunction
void SetUp() override
{
Aws::InitAPI(options);
{
Aws::Client::ClientConfiguration clientConfig;
clientConfig.region = REGION;
resourceHandler =
std::shared_ptr<IntegrationTestResourceHandler>(new IntegrationTestResourceHandler(clientConfig));
}
}

// cppcheck-suppress unusedFunction
void SetUp() override
{
Expand All @@ -146,7 +134,6 @@ class GlobalEnvironment : public ::testing::Environment
// cppcheck-suppress unusedFunction
void TearDown() override
{
resourceHandler->CleanUp();
if (CLEAN_UP)
{
printf("Clean up thingName: %s\n", THING_NAME.c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ class TestSecureTunnelingFeature : public ::testing::Test
{
if (!SKIP_ST)
{
ClientConfiguration clientConfig;
resourceHandler =
unique_ptr<IntegrationTestResourceHandler>(new IntegrationTestResourceHandler(clientConfig));
Aws::IoTSecureTunneling::Model::OpenTunnelResult openTunnelResult = resourceHandler->OpenTunnel(THING_NAME);
tunnelId = openTunnelResult.GetTunnelId();
sourceToken = openTunnelResult.GetSourceAccessToken();

Aws::IoTSecureTunneling::Model::OpenTunnelResult openTunnelResult = resourceHandler->OpenTunnel(THING_NAME);
tunnelId = openTunnelResult.GetTunnelId();
Expand Down
Loading