Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6e2be5e
fix techParam code list (with units)
YvanEuroArgo Jun 18, 2025
67e66b8
add tech timeseries e2e tests
YvanEuroArgo Jun 23, 2025
02b8c51
tentative fix for fail on corolis/dev
YvanEuroArgo Jun 23, 2025
9a74955
delete legacy tests
YvanEuroArgo Jun 25, 2025
0d0298c
fix techParam code list (with units)
YvanEuroArgo Jun 18, 2025
50a7f0e
WIP create ArgoFileValidator class
YvanEuroArgo Jun 30, 2025
c18e375
WIP refactor ArgoFileValidator
YvanEuroArgo Jun 30, 2025
2b9a59e
WIP refactor argoMetadateFileValidator
YvanEuroArgo Jul 1, 2025
dc3cff0
WIP refactor argoProfileFileValidator
YvanEuroArgo Jul 1, 2025
08b9ad2
refactor ArgoProfileFileValidator
YvanEuroArgo Jul 10, 2025
c7275bd
refactor ArgoTechnicalFileValidator
YvanEuroArgo Jul 10, 2025
f3150dd
refactor argoTrajFileValidator
YvanEuroArgo Jul 10, 2025
4fc89ac
refactor validate Submit with new ArgoFileValidator classes
YvanEuroArgo Jul 10, 2025
3149786
fix downcast of FileValidator classes
YvanEuroArgo Jul 11, 2025
f85eb4c
fix getFileName
YvanEuroArgo Jul 11, 2025
585eb3e
fix validationResult access in ResultsFile
YvanEuroArgo Jul 11, 2025
4910cca
fix build time series TECH_PARAM variables
YvanEuroArgo Sep 9, 2025
ddf84ca
add test file for Time Series
YvanEuroArgo Sep 9, 2025
7664854
change check of TECH_PARAM
YvanEuroArgo Sep 10, 2025
6f8f86e
fix ConfigTech null error
YvanEuroArgo Sep 11, 2025
ba3964f
add github CI for pushing docker image in package
YvanEuroArgo Sep 16, 2025
ac6bdb8
fix ci .yml file
YvanEuroArgo Sep 16, 2025
3f691b0
fix ci workflow context
YvanEuroArgo Sep 16, 2025
ac5ebc8
add workflow folder to detect changes for CI and test
YvanEuroArgo Sep 16, 2025
09fb7f7
minor code modif for CI test
YvanEuroArgo Sep 16, 2025
3fb4808
add permissions to workflow
YvanEuroArgo Sep 16, 2025
602089c
update ci with permissions
YvanEuroArgo Sep 17, 2025
5fc3764
update readme and provide compose.yaml to run filechecker with docker…
YvanEuroArgo Sep 17, 2025
e5c60cc
fix readme
YvanEuroArgo Sep 17, 2025
1d27f58
feat: demonstration
Sep 18, 2025
25f6f4c
Merge pull request #34 from OneArgo/feature/demo
YvanEuroArgo Sep 18, 2025
b7ce0cd
WIP update permissions on Dockerfile
YvanEuroArgo Sep 18, 2025
0613dff
fix Dockerfile
YvanEuroArgo Sep 18, 2025
d1eef30
corr readme
YvanEuroArgo Sep 18, 2025
2f03d56
change file name check error message
YvanEuroArgo Sep 4, 2025
2f9be3c
fix pom.xml
YvanEuroArgo Sep 23, 2025
f7f54b1
update table 41 PROGRAM_NAME
YvanEuroArgo Sep 23, 2025
c3918d3
update table SENSOR R27
YvanEuroArgo Sep 23, 2025
153505b
prepare release
YvanEuroArgo Sep 23, 2025
41cfff4
update argo-tech_names-spec table
YvanEuroArgo Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env.demo.bodc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# file checker image
FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
FILECHECKER_IMAGE_TAG=develop
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest

# External directories to mount to the container
FILECHECKER_SPEC_VOLUME=./file_checker_spec
FILECHECKER_INPUT_VOLUME=./demo/inputs/3901945
FILECHECKER_OUTPUT_VOLUME=./demo/outputs/3901945

# Variable specific to floats to check
DAC_NAME=bodc
FILECHECKER_OPTIONS=
FILES_NAMES=
14 changes: 14 additions & 0 deletions .env.demo.coriolis
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# file checker image
FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
FILECHECKER_IMAGE_TAG=develop
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest

# External directories to mount to the container
FILECHECKER_SPEC_VOLUME=./file_checker_spec
FILECHECKER_INPUT_VOLUME=./demo/inputs/2903996_coriolis
FILECHECKER_OUTPUT_VOLUME=./demo/outputs/2903996_coriolis

# Variable specific to floats to check
DAC_NAME=coriolis
FILECHECKER_OPTIONS=
FILES_NAMES=
18 changes: 18 additions & 0 deletions .env.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# file checker image
FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
FILECHECKER_IMAGE_TAG=develop
#availables tags at https://github.com/OneArgo/ArgoFormatChecker/tags + develop + latest

# External directories to mount to the container
FILECHECKER_SPEC_VOLUME=<path to the file_checker_spec directory>
FILECHECKER_INPUT_VOLUME=<path to input directory>
FILECHECKER_OUTPUT_VOLUME=<path to output directory>

# Variable specific to floats to check
DAC_NAME=<The dac name for the file to check>
FILECHECKER_OPTIONS=<optional list of options>
FILES_NAMES=<optional list of file names to process>

# Variable specific to Docker
DOCKER_UID=<user uid for output files>
DOCKER_GID=<user git for output files>
64 changes: 64 additions & 0 deletions .github/workflows/component-container-image-security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Generic security scan

on:
workflow_call:
inputs:
context:
description: "Path to the Dockerfile directory to analyse"
required: true
default: "."
type: string
image-path:
description: "Path of the docker image to analyse"
default: "ghcr.io/${{ github.repository }}/app"
type: string

permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status

jobs:
security-dependency-trivy:
name: Trivy dependency scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# need to format as github.repository contains uppercase
# and pull request workflow contains slashes
- id: format
name: Format proper image path and tag
env:
IMAGE_PATH: ${{ inputs.image-path }}
run: |
echo "image-tag=${GITHUB_REF_NAME/\//-}" >> $GITHUB_OUTPUT
echo "image-path=${IMAGE_PATH@L}" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v6
if: ${{ github.event_name != 'release' }}
with:
context: "{{defaultContext}}:${{ inputs.context }}"
tags: "${{ steps.format.outputs.image-path }}:${{ steps.format.outputs.image-tag }}"
push: false
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.28.0
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db,aquasec/trivy-db,ghcr.io/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db,aquasec/trivy-java-db,ghcr.io/aquasecurity/trivy-java-db
with:
image-ref: "${{ steps.format.outputs.image-path }}:${{ steps.format.outputs.image-tag }}"
format: 'sarif'
output: 'trivy-results.sarif'
vuln-type: "os,library"
severity: "CRITICAL,HIGH"
exit-code: "1"
ignore-unfixed: true
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'
- name: Inspect bandit SARIF report
if: always()
run: cat trivy-results.sarif
63 changes: 63 additions & 0 deletions .github/workflows/component-container-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build and push Docker image

on:
workflow_call:
inputs:
context:
description: "Path to the Dockerfile directory to build"
default: "."
type: string
image-path:
description: "Path of the docker image Tag"
default: "ghcr.io/${{ github.repository }}/app"
type: string

jobs:
container-image-build:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- id: format
name: Lowercase repository path
uses: ASzc/change-string-case-action@v1
with:
string: ${{ inputs.image-path }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build (pull request)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'pull_request'}}
with:
context: "{{defaultContext}}:${{ inputs.context }}"
tags: "${{ steps.format.outputs.lowercase }}:develop"
push: false
- name: Build and push (develop)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
with:
context: "{{defaultContext}}:${{ inputs.context }}"
tags: "${{ steps.format.outputs.lowercase }}:develop"
push: true
- name: Build and push (main)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
context: "{{defaultContext}}:${{ inputs.context }}"
tags: "${{ steps.format.outputs.lowercase }}:latest"
push: true
- name: Build and push (release)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' }}
with:
context: "{{defaultContext}}:${{ inputs.context }}"
tags: "${{ steps.format.outputs.lowercase }}:${{ github.ref_name }}"
push: true
30 changes: 30 additions & 0 deletions .github/workflows/workflow-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Image build

on:
push:
branches:
# Run on our main branch
- main
- develop
paths:
- file_checker_exec/**
pull_request:
# Run for any pull requests
paths:
- file_checker_exec/**
release:
types: [created]


jobs:
container-image-build:
uses: ./.github/workflows/component-container-image.yml
with:
context: file_checker_exec
image-path: ghcr.io/OneArgo/ArgoFormatChecker/app
container-image-security:
needs: [container-image-build]
uses: ./.github/workflows/component-container-image-security.yml
with:
context: file_checker_exec
image-path: ghcr.io/OneArgo/ArgoFormatChecker/app
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
demo/outputs/*
.env

!.gitkeep
118 changes: 101 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,117 @@
# Argo NetCDF file format checker

The Argo NetCDF file format checker performs format and content checks on Argo NetCDF files.
The Argo NetCDF format is described in "Argo user's manual" http://dx.doi.org/10.13155/29825
More information on https://www.argodatamgt.org/Documentation
The Argo NetCDF format is described in "Argo user's manual" <http://dx.doi.org/10.13155/29825>
More information on <https://www.argodatamgt.org/Documentation>
The format checker has two directories:

- file_checker_exec : the java code
- file_checker_spec : the rules applied on the NetCDF file by the java code

The rules files implement the Argo vocabularies managed on [NVS vocabulary server](https://vocab.nerc.ac.uk/search_nvs/).
Vocabularies and format changes are managed on [Argo Vocabs Task Team - AVTT GitHub](https://github.com/orgs/OneArgo/projects/4/views/1).

**With each release (from 2.9.2) you will find :**

- **file_checker_exec-[version].jar** which consolidates both application's compiled code and all its dependencies into a single executable file.
- source code
- source code

## Run Argo NetCDF file format checker
- Using file_checker_exec-[version].jar :

### Using file_checker_exec-{version}.jar :

```bash
java -jar file_checker_exec-{version}.jar $OPTION $DAC_NAME $SPEC $OUTPUT_DIR $INPUT_DIR [$FILES_NAMES]
```

$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.

### Run the application using Docker

```bash
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]
```

You need to mount external directories to the container :

[ABSOLUTE_PATH_TO_SPEC] : the file_checker_spec directory path.

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

[ABSOLUTE_PATH_TO_OUTPUT_DIR] : the directory where xml results files \*.filecheck will be created

Example :

```bash
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
```

### Run the application using Docker Compose

To facilitate the use of Argo file checker a compose.yaml and .env files are provided :

- Prepare your data.
- Copy `.env.docs` as `.env` file, and customize variables to configure the file checker for your environment.
- Download compose.yaml
- Run the service using Docker Compose:

```bash
docker compose -f compose.yaml up
```

or in background :

```bash
docker compose -f compose.yaml up -d
```

Example of an .env file :

```text
# file checker image
FILECHECKER_IMAGE=ghcr.io/oneargo/argoformatchecker/app
FILECHECKER_IMAGE_TAG=develop

# External directories to mount to the container
FILECHECKER_SPEC_VOLUME='D:\test_compose\file_checker_spec'
FILECHECKER_INPUT_VOLUME='D:\test_compose\data'
FILECHECKER_OUTPUT_VOLUME='D:\test_compose\results'

# Variable specific to floats to check
DAC_NAME=bodc
FILECHECKER_OPTIONS=
FILES_NAMES=
```

### Run the application on demonstration files

Demonstration data are availables to run the application locally easily.

- Clone the repository :

```bash
git clone https://github.com/OneArgo/ArgoFormatChecker.git
```

- Run the script dedicated

```bash
java -jar file_checker_exec-[version].jar $OPTION $DAC_NAME $SPEC $OUTPUT_DIR $INPUT_DIR $FILE_NAME
./run-file-checker-linux.sh
```

Only this JAR file is needed. You can delete legacy log4j2 & netcdf libraries jar files.
or for Windows :

```bash
./run-file-checker-windows.bat
```

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

### Test data

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

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

## TOOLS

Expand All @@ -39,31 +131,23 @@ git clone https://github.com/OneArgo/ArgoFormatChecker.git

- Build the application with maven (will requiert Java jdk installed), in file_checker_exec folder :


```bash
cd file_checker_exec
./mvnw clean install
```

In target folder you will find both original-file_checker_exec and file_checker_exec-[version]. It is this last one to use.


### Using docker

### build docker image

- Build the application with Docker :

```
```bash
docker build -t filechecker_2.8.14 .
```

- Run the application using Docker

```
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
```

### Run integration tests

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

```bash
Expand Down
12 changes: 12 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
argo-netcdf-checker:
container_name: ArgoFormatChecker
image: ${FILECHECKER_IMAGE}:${FILECHECKER_IMAGE_TAG}
user: "${DOCKER_UID:-0}:${DOCKER_GID:-0}"
group_add:
- 1001
volumes:
- ${FILECHECKER_SPEC_VOLUME}:/app/file_checker_spec:ro
- ${FILECHECKER_INPUT_VOLUME}:/app/data:ro
- ${FILECHECKER_OUTPUT_VOLUME}:/app/results:rw
command: ${FILECHECKER_OPTIONS} ${DAC_NAME} ./file_checker_spec ./results ./data ${FILES_NAMES}
Binary file added demo/inputs/2903996_coriolis/2903996_Rtraj.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/2903996_meta.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/2903996_tech.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_001.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_001D.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_002.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_003.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_009.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_010.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_011.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_012.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_013.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_014.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_015.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_016.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_017.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_018.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_019.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_020.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_023.nc
Binary file not shown.
Binary file added demo/inputs/2903996_coriolis/R2903996_024.nc
Binary file not shown.
Binary file added demo/inputs/3901945/3901945_Rtraj.nc
Binary file not shown.
Binary file added demo/inputs/3901945/3901945_meta.nc
Binary file not shown.
Binary file added demo/inputs/3901945/3901945_tech.nc
Binary file not shown.
Binary file added demo/inputs/3901945/BD3901945_004.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_001D.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_002.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_003.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_004.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_005.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_006.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_007.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_008.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_009.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_010.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_011.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_012.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_013.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_014.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_015.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_016.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_017.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_018.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_019.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_020.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_021.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_022.nc
Binary file not shown.
Binary file added demo/inputs/3901945/D3901945_023.nc
Binary file not shown.
Loading
Loading