-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from veblush/gcs-docker
Added a docker file for GCS Java Benchmark
- Loading branch information
Showing
4 changed files
with
72 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ bin | |
|
||
# OS X | ||
.DS_Store | ||
|
||
# VisualStudio Code | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
### How to build and upload it to the registry | ||
|
||
This is an example that the gRPC team uses internally, so you may need to change `IMAGE_NAME`` for your needs. | ||
|
||
#### Build and upload new docker image | ||
|
||
Update the `IMAGE_VERSION`` to match the version of the image you want to use. | ||
Execute this command from the root directory of this repository. | ||
|
||
``` | ||
export IMAGE_NAME=us-docker.pkg.dev/grpc-testing/testing-images-public/grpc-gcp-java-gcs-benchmark | ||
export IMAGE_VERSION=20231103.0 | ||
docker build -t $IMAGE_NAME:$IMAGE_VERSION -f end2end-test-examples/gcs/docker/Dockerfile . | ||
docker push $IMAGE_NAME:$IMAGE_VERSION | ||
``` | ||
|
||
#### Add latest label to the image (optional) | ||
|
||
``` | ||
docker tag $IMAGE_NAME:$IMAGE_VERSION $IMAGE_NAME:latest | ||
docker push $IMAGE_NAME:latest | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2023 gRPC authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License 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. | ||
|
||
FROM debian:stable | ||
|
||
# Install Java 11 SDK | ||
# (Based on https://adoptium.net/installation/linux/#_deb_installation_on_debian_or_ubuntu) | ||
RUN apt update && apt install -y wget apt-transport-https && \ | ||
mkdir -p /etc/apt/keyrings && \ | ||
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc && \ | ||
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list && \ | ||
apt update && apt install -y temurin-11-jdk | ||
|
||
# Copy source and build gcs-benchmark | ||
COPY ./end2end-test-examples/gcs /work | ||
RUN cd /work && ./gradlew build | ||
|
||
# Creating a new slim docker with the benchmark binary only | ||
FROM debian:stable-slim | ||
# Install Java 11 JRE | ||
RUN apt update && apt install -y wget apt-transport-https && \ | ||
mkdir -p /etc/apt/keyrings && \ | ||
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc && \ | ||
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list && \ | ||
apt update && apt install -y temurin-11-jre | ||
COPY --from=0 /work/build/libs/ / | ||
CMD ["java"] |