Skip to content

Commit 7356055

Browse files
authored
Merge pull request #40 from OneArgo/update/table27_RBR_CTD_TEMP_CNDC
Update/table27 rbr ctd temp cndc
2 parents d62796c + 61fecd6 commit 7356055

39 files changed

Lines changed: 4115 additions & 28 deletions

.env.demo.bodc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ FILECHECKER_IMAGE_TAG=develop
44
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest
55

66
# External directories to mount to the container
7-
FILECHECKER_SPEC_VOLUME=./file_checker_spec
87
FILECHECKER_INPUT_VOLUME=./demo/inputs/3901945
98
FILECHECKER_OUTPUT_VOLUME=./demo/outputs/3901945
109

.env.demo.coriolis

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ FILECHECKER_IMAGE_TAG=develop
44
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest
55

66
# External directories to mount to the container
7-
FILECHECKER_SPEC_VOLUME=./file_checker_spec
87
FILECHECKER_INPUT_VOLUME=./demo/inputs/2903996
98
FILECHECKER_OUTPUT_VOLUME=./demo/outputs/2903996
109

.env.docs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ FILECHECKER_IMAGE_TAG=develop
44
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest
55

66
# External directories to mount to the container
7-
FILECHECKER_SPEC_VOLUME=<path to the file_checker_spec directory>
87
FILECHECKER_INPUT_VOLUME=<path to input directory>
98
FILECHECKER_OUTPUT_VOLUME=<path to output directory>
109

.github/workflows/component-container-image.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ on:
1111
description: "Path of the docker image Tag"
1212
default: "ghcr.io/${{ github.repository }}/app"
1313
type: string
14+
target:
15+
description: "Target build stage for Docker multistage build"
16+
required: false
17+
type: string
18+
file:
19+
description: "Path to the Dockerfile."
20+
required: false
21+
type: string
1422

1523
jobs:
1624
container-image-build:
@@ -35,11 +43,20 @@ jobs:
3543
password: ${{ secrets.GITHUB_TOKEN }}
3644
- name: Build (pull request)
3745
uses: docker/build-push-action@v6
38-
if: ${{ github.event_name == 'pull_request'}}
46+
if: ${{ github.event_name == 'pull_request' && (inputs.target == '' || inputs.target == null) }}
3947
with:
4048
context: "{{defaultContext}}:${{ inputs.context }}"
4149
tags: "${{ steps.format.outputs.lowercase }}:develop"
4250
push: false
51+
- name: Build with target (pull request)
52+
uses: docker/build-push-action@v6
53+
if: ${{ github.event_name == 'pull_request' && inputs.target != '' && inputs.target != null }}
54+
with:
55+
context: "{{defaultContext}}:${{ inputs.context }}"
56+
target: ${{ inputs.target }}
57+
file: ${{ inputs.file }}
58+
tags: "${{ steps.format.outputs.lowercase }}:develop"
59+
push: false
4360
- name: Build and push (develop)
4461
uses: docker/build-push-action@v6
4562
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
@@ -49,15 +66,33 @@ jobs:
4966
push: true
5067
- name: Build and push (main)
5168
uses: docker/build-push-action@v6
52-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
69+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && (inputs.target == '' || inputs.target == null) }}
5370
with:
5471
context: "{{defaultContext}}:${{ inputs.context }}"
5572
tags: "${{ steps.format.outputs.lowercase }}:latest"
5673
push: true
74+
- name: Build and push with target (main)
75+
uses: docker/build-push-action@v6
76+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && inputs.target != '' && inputs.target != null }}
77+
with:
78+
context: "{{defaultContext}}:${{ inputs.context }}"
79+
target: ${{ inputs.target }}
80+
file: ${{ inputs.file }}
81+
tags: "${{ steps.format.outputs.lowercase }}:latest"
82+
push: true
5783
- name: Build and push (release)
5884
uses: docker/build-push-action@v6
59-
if: ${{ github.event_name == 'release' }}
85+
if: ${{ github.event_name == 'release' && (inputs.target == '' || inputs.target == null) }}
86+
with:
87+
context: "{{defaultContext}}:${{ inputs.context }}"
88+
tags: "${{ steps.format.outputs.lowercase }}:${{ github.ref_name }}"
89+
push: true
90+
- name: Build and push with target (release)
91+
uses: docker/build-push-action@v6
92+
if: ${{ github.event_name == 'release' && inputs.target != '' && inputs.target != null }}
6093
with:
6194
context: "{{defaultContext}}:${{ inputs.context }}"
95+
target: ${{ inputs.target }}
96+
file: ${{ inputs.file }}
6297
tags: "${{ steps.format.outputs.lowercase }}:${{ github.ref_name }}"
6398
push: true

.github/workflows/workflow-java.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ on:
88
- develop
99
paths:
1010
- file_checker_exec/**
11+
- file_checker_spec/**
12+
- Dockerfile
1113
pull_request:
1214
# Run for any pull requests
1315
paths:
1416
- file_checker_exec/**
17+
- file_checker_spec/**
18+
- Dockerfile
1519
release:
1620
types: [created]
1721

@@ -20,5 +24,5 @@ jobs:
2024
container-image-build:
2125
uses: ./.github/workflows/component-container-image.yml
2226
with:
23-
context: file_checker_exec
27+
context: .
2428
image-path: ghcr.io/OneArgo/ArgoFormatChecker/app
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Image build
2+
3+
on:
4+
push:
5+
branches:
6+
# Run on our main branch
7+
- main
8+
- develop
9+
paths:
10+
- file_checker_python/**
11+
pull_request:
12+
# Run for any pull requests
13+
paths:
14+
- file_checker_python/**
15+
release:
16+
types: [created]
17+
18+
19+
jobs:
20+
container-image-build-wrapper:
21+
uses: ./.github/workflows/component-container-image.yml
22+
with:
23+
context: .
24+
file: "python.Dockerfile"
25+
target: file-checker-python
26+
image-path: ghcr.io/OneArgo/ArgoFormatChecker/python-wrapper
27+
container-image-build-api:
28+
uses: ./.github/workflows/component-container-image.yml
29+
with:
30+
context: .
31+
file: "python.Dockerfile"
32+
target: file-checker-api
33+
image-path: ghcr.io/OneArgo/ArgoFormatChecker/python-api

.gitlab-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
include:
33
- component: $CI_SERVER_FQDN/dev-ops/templates/automatisation/ci-cd/pipeline-java-container-image@~latest
44
inputs:
5-
container_image_build_context: "./file_checker_exec"
6-
container_image_docker_file_path: "./file_checker_exec/Dockerfile"
75
java_builder_artifacts_path: "**/target/*.{war,jar}"
86
java_builder_build_command: "clean package -f file_checker_exec/pom.xml"
97
java_builder_maven_quality_enable: "false"
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ LABEL org.opencontainers.image.vendor="OneArgo"
1111

1212
WORKDIR /build
1313

14-
COPY ./.mvn ./.mvn
15-
COPY ./mvnw ./mvnw
16-
COPY ./pom.xml ./pom.xml
17-
COPY ./src ./src
14+
COPY ./file_checker_exec/.mvn ./.mvn
15+
COPY ./file_checker_exec/mvnw ./mvnw
16+
COPY ./file_checker_exec/pom.xml ./pom.xml
17+
COPY ./file_checker_exec/src ./src
18+
1819

1920
# Ensure mvnw has execution permissions
2021
RUN chmod +x ./mvnw \
@@ -36,6 +37,9 @@ RUN set -e \
3637

3738
# Copy the built jar file to the runtime stage
3839
COPY --from=builder --chown=root:gcontainer --chmod=750 /build/target/file_checker*.jar app.jar
40+
# Copy the specs :
41+
COPY file_checker_spec /app/file_checker_spec
42+
3943
# Specify the default command for running the app
4044
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
4145

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@ $FILES_NAMES is a list of file's name from the INPUT_DIR. It is optional : witho
2828

2929
### Run the application using Docker
3030

31+
```bash
32+
docker run --rm -v [ABSOLUTE_PATH_TO_DATA_FOLDER]:/app/data -v [ABSOLUTE_PATH_TO_OUTPUT_DIR]:/app/results ghcr.io/oneargo/argoformatchecker/app:{TAG} [$OPTIONS] $DAC_NAME ./file_checker_spec ./results ./data [$FILES_NAMES]
33+
```
34+
35+
Or if you want to use your own specification files :
36+
3137
```bash
3238
docker run --rm -v [ABSOLUTE_PATH_TO_SPEC]:/app/file_checker_spec -v [ABSOLUTE_PATH_TO_DATA_FOLDER]:/app/data -v [ABSOLUTE_PATH_TO_OUTPUT_DIR]:/app/results ghcr.io/oneargo/argoformatchecker/app:{TAG} [$OPTIONS] $DAC_NAME ./file_checker_spec ./results ./data [$FILES_NAMES]
3339
```
3440

3541
You need to mount external directories to the container :
3642

37-
[ABSOLUTE_PATH_TO_SPEC] : the file_checker_spec directory path.
43+
[ABSOLUTE_PATH_TO_SPEC] : OPTIONAL - The file_checker_spec directory path (if you don't want to use the specs included in the docker container).
3844

3945
[ABSOLUTE_PATH_TO_DATA_FOLDER] : Path to directory containing the argo necdf files to be checked. The fileChecker will not seek files in subfolders
4046

@@ -43,7 +49,7 @@ You need to mount external directories to the container :
4349
Example :
4450

4551
```bash
46-
docker run --rm -v D:\test_file_checker\file_checker_spec:/app/file_checker_spec -v D:\test_file_checker\datatest:/app/data -v D:\test_file_checker\results:/app/results ghcr.io/oneargo/argoformatchecker/app:develop -no-name-check coriolis ./file_checker_spec ./results ./data
52+
docker run --rm -v D:\test_file_checker\datatest:/app/data -v D:\test_file_checker\results:/app/results ghcr.io/oneargo/argoformatchecker/app:develop -no-name-check coriolis ./file_checker_spec ./results ./data
4753
```
4854

4955
### Run the application using Docker Compose
@@ -73,7 +79,6 @@ FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
7379
FILECHECKER_IMAGE_TAG=develop
7480
7581
# External directories to mount to the container
76-
FILECHECKER_SPEC_VOLUME='D:\test_compose\file_checker_spec'
7782
FILECHECKER_INPUT_VOLUME='D:\test_compose\data'
7883
FILECHECKER_OUTPUT_VOLUME='D:\test_compose\results'
7984
@@ -107,12 +112,20 @@ or for Windows :
107112

108113
output files will be generated in `./demo/outputs`.
109114

115+
### Run File checker using Python and an API
116+
117+
In folder /file-checker-python you will find a python wrapper and an API to facilitate the use of Argo FileChecker. See python.README for more informations.
118+
110119
### Test data
111120

112121
To further test the Argo File Checker, you will find argo data here : https://www.argodatamgt.org/DataAccess.html
113122

114123
The Argo File Checker is not yet designed to checking *prof.nc and *Sprof.nc. It checks only TRAJ, META, TECH and PROFILES files.
115124

125+
## Run File checker using Python and an API
126+
127+
In folder /argo-file-checker-python you will find a python wrapper and an API to facilitate the use of Argo FileChecker.
128+
116129
## TOOLS
117130

118131
### Maven Wrapper

compose.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ services:
55
user: "${DOCKER_UID:-0}:${DOCKER_GID:-0}"
66
group_add:
77
- 1001
8-
volumes:
9-
- ${FILECHECKER_SPEC_VOLUME}:/app/file_checker_spec:ro
8+
volumes:
109
- ${FILECHECKER_INPUT_VOLUME}:/app/data:ro
1110
- ${FILECHECKER_OUTPUT_VOLUME}:/app/results:rw
1211
command: ${FILECHECKER_OPTIONS} ${DAC_NAME} ./file_checker_spec ./results ./data ${FILES_NAMES}

0 commit comments

Comments
 (0)