Skip to content

Commit 5fc3764

Browse files
committed
update readme and provide compose.yaml to run filechecker with docker compose
1 parent 602089c commit 5fc3764

4 files changed

Lines changed: 92 additions & 9 deletions

File tree

.env.docs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# file checker image
2+
FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
3+
FILECHECKER_IMAGE_TAG=develop
4+
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest
5+
6+
# External directories to mount to the container
7+
FILECHECKER_SPEC_VOLUME=<path to the file_checker_spec directory>
8+
FILECHECKER_INPUT_VOLUME=<path to input directory>
9+
FILECHECKER_OUTPUT_VOLUME=<path to output directory>
10+
11+
# Variable specific to floats to check
12+
DAC_NAME=<The dac name for the file to check>
13+
FILECHECKER_OPTIONS=<optional list of options>
14+
FILES_NAMES=<optional list of file names to process>
15+

README.md

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,65 @@ Vocabularies and format changes are managed on [Argo Vocabs Task Team - AVTT Git
1414
- source code
1515

1616
## Run Argo NetCDF file format checker
17-
- Using file_checker_exec-[version].jar :
17+
### Using file_checker_exec-{version}.jar :
1818
```bash
19-
java -jar file_checker_exec-[version].jar $OPTION $DAC_NAME $SPEC $OUTPUT_DIR $INPUT_DIR $FILE_NAME
19+
java -jar file_checker_exec-{version}.jar $OPTION $DAC_NAME $SPEC $OUTPUT_DIR $INPUT_DIR [$FILES_NAMES]
2020
```
21+
$FILES_NAMES is a list of file's name from the INPUT_DIR. It is optional : without it, all files from INPUT_DIR will be checked.
2122

22-
Only this JAR file is needed. You can delete legacy log4j2 & netcdf libraries jar files.
23+
### Run the application using Docker
24+
25+
```bash
26+
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} $DAC_NAME ./file_checker_spec ./results ./data [$FILES_NAMES]
27+
```
28+
You need to mount external directories to the container :
29+
30+
[ABSOLUTE_PATH_TO_SPEC] : the file_checker_spec directory path.
31+
32+
[ABSOLUTE_PATH_TO_DATA_FOLDER] : Path to directory containing the argo necdf files to be checked. The fileChecker will not seek files in subfolders
33+
34+
[ABSOLUTE_PATH_TO_OUTPUT_DIR] : the directory where xml results files *.filecheck will be created
35+
36+
Example :
37+
```bash
38+
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
39+
```
40+
41+
### Run the application using Docker Compose
42+
To facilitate the use of Argo file checker a compose.yaml and .env files are provided :
43+
44+
- Prepare your data.
45+
- Copy `.env.docs` as `.env` file, and customize variables to configure the file checker for your environment.
46+
- Download compose.yaml
47+
- Run te service using Docker Compose:
48+
```bash
49+
docker compose -f compose.yaml up
50+
```
51+
or in background :
52+
53+
```bash
54+
docker compose -f compose.yaml up -d
55+
```
56+
Example of an .env file :
57+
```
58+
# file checker image
59+
FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
60+
FILECHECKER_IMAGE_TAG=develop
61+
62+
# External directories to mount to the container
63+
FILECHECKER_SPEC_VOLUME='D:\test_compose\file_checker_spec'
64+
FILECHECKER_INPUT_VOLUME='D:\test_compose\data'
65+
FILECHECKER_OUTPUT_VOLUME='D:\test_compose\results'
66+
67+
# Variable specific to floats to check
68+
DAC_NAME=bodc
69+
FILECHECKER_OPTIONS=
70+
FILES_NAMES=
71+
72+
```
73+
### Test data :
74+
To test the Argo File Checker, you will find argo data here : https://www.argodatamgt.org/DataAccess.html
75+
The Argo File Checker is not yet designed to checking *prof.nc and *Sprof.nc. It checks only TRAJ, META, TECH and PROFILES files.
2376

2477
## TOOLS
2578

@@ -48,7 +101,7 @@ cd file_checker_exec
48101
In target folder you will find both original-file_checker_exec and file_checker_exec-[version]. It is this last one to use.
49102

50103

51-
### Using docker
104+
### build docker image
52105

53106

54107
- Build the application with Docker :
@@ -57,11 +110,6 @@ In target folder you will find both original-file_checker_exec and file_checker_
57110
docker build -t filechecker_2.8.14 .
58111
```
59112

60-
- Run the application using Docker
61-
62-
```
63-
docker run --rm -v [ABSOLUTE_PATH_TO_file_checker_spec]:/app/file_checker_spec -v [ABSOLUTE_PATH_TO_DATA_FOLDER]:/app/data -v [ABSOLUTE_PATH_TO_OUTPUT_DIR]:/app/results filechecker_2.8.14:latest $DAC_NAME ./file_checker_spec ./results ./data $FILE_NAME
64-
```
65113

66114
### Run integration tests
67115
The source code comes with some netcdf test files. You can run the integration tests with this following command :

compose.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
argo-netcdf-checker:
3+
container_name: ArgoFormatChecker
4+
image: ${FILECHECKER_IMAGE}:${FILECHECKER_IMAGE_TAG}
5+
env_file:
6+
- .env
7+
volumes:
8+
- ${FILECHECKER_SPEC_VOLUME}:/app/file_checker_spec:ro
9+
- ${FILECHECKER_INPUT_VOLUME}:/app/data:ro
10+
- ${FILECHECKER_OUTPUT_VOLUME}:/app/results:rw
11+
command: ${FILECHECKER_OPTIONS} ${DAC_NAME} ./file_checker_spec ./results ./data ${FILES_NAMES}

file_checker_exec/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
FROM eclipse-temurin:21-jdk-alpine AS builder
22

3+
LABEL org.opencontainers.image.authors="yvan.lubac@euro-argo.eu"
4+
LABEL org.opencontainers.image.description="Docker Image for Argo netcdf File Checler"
5+
LABEL org.opencontainers.image.url="https://github.com/OneArgo/ArgoFormatChecker"
6+
LABEL org.opencontainers.image.source="https://github.com/OneArgo/ArgoFormatChecker"
7+
LABEL org.opencontainers.image.documentation="https://github.com/OneArgo/ArgoFormatChecker"
8+
LABEL org.opencontainers.image.licenses="TBD"
9+
LABEL org.opencontainers.image.vendor="OneArgo"
10+
11+
312
WORKDIR /build
413

514
COPY ./.mvn ./.mvn

0 commit comments

Comments
 (0)