Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/production' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
bou3108 committed Oct 7, 2022
2 parents 39700c0 + 6d4222c commit a276b32
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
11 changes: 1 addition & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@ COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml -gs /usr/share/maven/ref/settings-docker.xml -Dextract.test.name=Extraction_Pro_sante_connect_cartes_de_test_bascule -DskipTests clean package

FROM openjdk:11-slim-buster
RUN echo "deb [trusted=yes] http://repo.proxy-dev-forge.asip.hst.fluxus.net/artifactory/debian.org buster main" > /etc/apt/sources.list \
&& echo "deb [trusted=yes] http://repo.proxy-dev-forge.asip.hst.fluxus.net/artifactory/debian.org buster-updates main" >> /etc/apt/sources.list \
&& apt update \
&& apt install -y --allow-downgrades wget gnupg=2.2.12-1+deb10u1 gpgv=2.2.12-1+deb10u1 dos2unix \
&& wget -qO - http://repo.proxy-dev-forge.asip.hst.fluxus.net/artifactory/www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - \
&& echo "deb [trusted=yes] http://repo.proxy-dev-forge.asip.hst.fluxus.net/artifactory/debian-repo.mongodb.org buster/mongodb-org/5.0 main" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list
RUN apt update
RUN apt install -y mongodb-database-tools mongodb-mongosh=1.5.0
COPY --from=build /usr/src/app/target/pscextract-*.jar /usr/app/pscextract.jar
RUN mkdir -p /app/extract-repo && mkdir -p /app/resources
COPY --from=build /usr/src/app/src/main/resources/aggregate.mongo /app/resources/
RUN usermod -d /app daemon && chown -R daemon: /app
USER daemon
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/app/pscextract.jar"]
ENTRYPOINT ["sh", "-c", "exec java -jar /usr/app/pscextract.jar"]
9 changes: 1 addition & 8 deletions Dockerfile.ext
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@ COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml clean package -DskipTests=true

FROM openjdk:11-slim-buster
RUN apt update \
&& apt install -y wget gnupg dos2unix \
&& wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - \
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list
RUN apt update
RUN apt install -y mongodb-database-tools mongodb-mongosh
COPY --from=build /usr/src/app/target/pscextract-*.jar /usr/app/pscextract.jar
RUN mkdir -p /app/extract-repo && mkdir -p /app/resources
COPY --from=build /usr/src/app/src/main/resources/aggregate.mongo /app/resources/
RUN chown -R daemon: /app
USER daemon
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/app/pscextract.jar"]
ENTRYPOINT ["sh", "-c", "exec java -jar /usr/app/pscextract.jar"]

11 changes: 2 additions & 9 deletions pscextract.nomad.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ job "pscextract" {
value = "data"
}

update {
max_parallel = 1
min_healthy_time = "30s"
progress_deadline = "5m"
healthy_deadline = "2m"
}

network {
port "http" {
to = 8080
Expand Down Expand Up @@ -72,7 +65,7 @@ job "pscextract" {
}
driver = "docker"
env {
JAVA_TOOL_OPTIONS = "-Dspring.config.location=/secrets/application.properties -Xms256m -Xmx1792m -XX:+UseG1GC"
JAVA_TOOL_OPTIONS = "-Dspring.config.location=/secrets/application.properties -Xms256m -Xmx2048m -XX:+UseG1GC"
}
config {
extra_hosts = [ "psc-api-maj.internal:$\u007BNOMAD_IP_http\u007D" ]
Expand Down Expand Up @@ -125,7 +118,7 @@ EOF
}
resources {
cpu = 1000
memory = 2148
memory = 2560
}
service {
name = "$\u007BNOMAD_NAMESPACE\u007D-$\u007BNOMAD_JOB_NAME\u007D"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public File extractToCsv(ExtractionController extractionController) throws IOExc
BigDecimal size = BigDecimal.valueOf(extractionController.getPageSize());
List<Ps> response = extractionController.getPsApi().getPsByPage(BigDecimal.valueOf(page), size);
assert !response.isEmpty();
log.info("number of Ps : {}", response.size());
log.info("Page " + page + " of size " + size + " received");
log.debug("number of Ps : {}", response.size());
log.debug("Page " + page + " of size " + size + " received");
boolean outOfPages = false;

do {
Expand All @@ -273,7 +273,7 @@ public File extractToCsv(ExtractionController extractionController) throws IOExc
page++;
try {
response = extractionController.getPsApi().getPsByPage(BigDecimal.valueOf(page), size);
log.info("Page " + page + " of size " + size + " received, writing to file...");
log.debug("Page " + page + " of size " + size + " received, writing to file...");
} catch (HttpStatusCodeException e) {
log.warn("Out of pages: " + e.getMessage());
if (e.getStatusCode() != HttpStatus.GONE) {
Expand Down
1 change: 1 addition & 0 deletions waypoint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ app "prosanteconnect/pscextract" {
"proxy_address" = var.proxy_address
}
dockerfile = "${path.app}/${var.dockerfile_path}"
disable_entrypoint = true
}
# Uncomment below to use a remote docker registry to push your built images.
registry {
Expand Down

0 comments on commit a276b32

Please sign in to comment.