Skip to content

Commit

Permalink
ARC-1238: Unrelated cleanup :)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrichner-oviva committed Feb 8, 2024
1 parent 9eee8a6 commit 5b3c43a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ env:

jobs:
deploy:
env:
DOCKER_REPO: 'europe-docker.pkg.dev/oviva-pkg/ovi/'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Setup Java
Expand All @@ -27,12 +28,6 @@ jobs:
echo "parsing version from ref '$GITHUB_REF'"
VERSION=$(echo "$GITHUB_REF" | sed -e 's|.*/ehealthid-relying-party/v\(.*\)|\1|g')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Update Version
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
echo "updating version to '$VERSION'"
make update-version "VERSION=$VERSION"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -44,11 +39,14 @@ jobs:
- id: buildx
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Update Version
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
echo "updating version to '$VERSION'"
make update-version "VERSION=$VERSION"
- name: Build and push Image
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
make dist RELEASE_TAG=v$VERSION
permissions:
contents: read
packages: write
make dist RELEASE_TAG=v$VERSION
45 changes: 33 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,44 @@ LABEL org.opencontainers.image.source="https://github.com/oviva-ag/ehealthid-rel

ARG JAVA_PACKAGE=java-21-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
ARG OTEL_AGENT_VERSION=v1.32.1

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf -y install ca-certificates ${JAVA_PACKAGE} \
&& microdnf -y update \
&& microdnf clean all \
&& mkdir /deployments \
&& chown 1001 /deployments \
&& chmod "g+rwX" /deployments \
&& chown 1001:root /deployments \
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
&& chown 1001 /deployments/run-java.sh \
&& chmod 540 /deployments/run-java.sh \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security \
&& echo "securerandom.strongAlgorithms=NativePRNGNonBlocking:SUN,DRBG:SUN" >> /etc/alternatives/jre/conf/security/java.security
RUN <<EOF
microdnf -y update
microdnf -y install ca-certificates ${JAVA_PACKAGE}
microdnf clean all
mkdir /deployments
chown 1001 /deployments
chmod "g+rwX" /deployments
chown 1001:root /deployments
curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh
chown 1001 /deployments/run-java.sh
chmod 540 /deployments/run-java.sh
curl "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/${OTEL_AGENT_VERSION}/opentelemetry-javaagent.jar" -o opentelemetry-javaagent.jar -L
echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security
echo "securerandom.strongAlgorithms=NativePRNGNonBlocking:SUN,DRBG:SUN" >> /etc/alternatives/jre/conf/security/java.security
EOF

# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-javaagent:/opentelemetry-javaagent.jar -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

# Configure OpenTelemetry
ENV OTEL_JAVAAGENT_DEBUG=false
ENV OTEL_JAVAAGENT_ENABLED=false
ENV OTEL_METRICS_EXPORTER=none
ENV OTEL_LOGS_EXPORTER=none
ENV OTEL_TRACES_EXPORTER=otlp
ENV OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc

## Allowlist instrumented components for faster startup
ENV OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED=false
ENV OTEL_INSTRUMENTATION_JAVA_HTTP_CLIENT_ENABLED=true
ENV OTEL_INSTRUMENTATION_JAXRS_ENABLED=true
ENV OTEL_INSTRUMENTATION_UNDERTOW_ENABLED=true

COPY --chown=1001 ehealthid-rp/target/ehealthid-rp-jar-with-dependencies.jar /deployments/

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# TODO
In order of priority:
- [ ] Health endpoint - sanity check whether Jakarta ws is up should be enough. I.e. `/health`
- [ ] Continuous Deployment
- [ ] Helm chart (externally)
- [ ] Internationalization (ResourceBundles) for templates (en & de)
Expand Down
7 changes: 0 additions & 7 deletions ehealthid-rp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.16.1</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down

0 comments on commit 5b3c43a

Please sign in to comment.