Skip to content

Commit

Permalink
Merge pull request #171 from veblush/gcs-docker
Browse files Browse the repository at this point in the history
Added a docker file for GCS Java Benchmark
  • Loading branch information
veblush committed Nov 6, 2023
2 parents 314967f + 5fd53da commit 5485d25
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ bin

# OS X
.DS_Store

# VisualStudio Code
.vscode
17 changes: 9 additions & 8 deletions end2end-test-examples/gcs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

def gcsioVersion = '2.2.17'
def grpcVersion = '1.58.0'
def protobufVersion = '3.24.3'
def gcsioVersion = '2.2.18'
def grpcVersion = '1.59.0'
def protobufVersion = '3.24.4'
def protocVersion = protobufVersion
def conscryptVersion = '2.5.2'

Expand All @@ -26,24 +26,25 @@ dependencies {
compile "io.grpc:grpc-auth:${grpcVersion}"
compile "io.grpc:grpc-census:${grpcVersion}"
compile "io.grpc:grpc-context:${grpcVersion}"
compile "io.grpc:grpc-core:${grpcVersion}"
compile "io.grpc:grpc-googleapis:${grpcVersion}"
compile "io.grpc:grpc-netty-shaded:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-protobuf-lite:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
compile "io.grpc:grpc-testing:${grpcVersion}"
compile "io.grpc:grpc-xds:${grpcVersion}"
compile "org.conscrypt:conscrypt-openjdk-uber:${conscryptVersion}"
compile "com.google.protobuf:protobuf-java-util:${protobufVersion}"
compile "com.google.api.grpc:grpc-google-cloud-storage-v2:latest.release"
compile "com.google.api.grpc:proto-google-iam-v1:latest.release"
compile "com.google.api.grpc:proto-google-common-protos:latest.release"
compile "com.google.api.grpc:proto-google-iam-v1:latest.release"
compile "com.google.apis:google-api-services-storage:latest.release"
compile "com.google.auth:google-auth-library-oauth2-http:latest.release"
compile "com.google.cloud:google-cloud-storage:latest.release"
compile "com.google.apis:google-api-services-storage:latest.release"
compile "com.google.cloud.bigdataoss:gcsio:${gcsioVersion}"
compile "com.google.cloud.bigdataoss:bigdataoss-parent:${gcsioVersion}"
compile "com.google.guava:guava:32.1.2-jre"
compile "com.google.cloud.bigdataoss:gcsio:${gcsioVersion}"
compile "com.google.guava:guava:32.1.3-jre"
compile "net.sourceforge.argparse4j:argparse4j:0.9.0"

testCompile group: 'junit', name: 'junit', version: '4.12'
Expand Down
22 changes: 22 additions & 0 deletions end2end-test-examples/gcs/docker/BUILDING.md
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
```
38 changes: 38 additions & 0 deletions end2end-test-examples/gcs/docker/Dockerfile
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"]

0 comments on commit 5485d25

Please sign in to comment.