Data model and code generation for the Calycopis Execution Broker.
- This project defines the OpenAPI schema for the IVOA Execution Broker service and generates client and server packages from it.
- The schema is defined as a set of YAML files under
schema/v1.0/, withexecution-broker.yamlas the top-level entry point. - A pre-processor (isobeon) resolves
$refreferences and merges the multi-file schema into a single output file used by code generators. - Code is generated for three targets: a Java Spring Boot server library (
calycopis-spring), a Java client library (calycopis-client), and a Python client library (calycopis_client).
schema/v1.0/- The source OpenAPI 3.1.0 schema files.execution-broker.yaml- Top-level schema entry point.components.yaml- Shared component definitions.components/- Individual component schema files (executables, compute, storage, data, sessions, etc.).types/- Reusable type definitions (options, updates, messages, lifecycle, schedule).
schema/build/- Output directory for the processed (merged) schema file.isobeon/- The schema pre-processor (Python). Resolves$refreferences and produces a single merged YAML file.bin/buildscripts.sh- Shell functions for building the schema and all generated packages.codegen/java/spring/- Maven project that generates the Java Spring Boot server classes from the schema.codegen/java/client/- Maven project that generates the Java client classes from the schema.codegen/python/client/- Python client package generation.wrappers/- Hand-written wrapper layer (execution_client.py) providing a higher-level API on top of the generated client.build/- Output directory for the generated Python client package.
project.properties- Schema path and version properties.config.yaml- Project configuration file.
- Python 3.9+ with
pyyaml(for the schema pre-processor) - Java 21 (for the Maven-based code generators)
- Maven (provided via
mvnwwrapper in each Java codegen project) - pip, build, and twine (for building the Python package)
- OpenAPI Generator CLI 7.18.0 (downloaded automatically by
installgenerator)
The build functions are defined in bin/buildscripts.sh. Source this file first:
source bin/buildscripts.sh
All commands below assume the working directory is the project root:
/calycopis/Calycopis-schema/github-zrq/
pip install -r isobeon/requirements.txt
The buildschema function runs the isobeon pre-processor to merge the multi-file
schema into a single YAML file at schema/build/execution-broker-1.0.4.yaml.
buildschema
This is equivalent to:
mkdir -p schema/build
python isobeon/schema-processor.py \
schema/v1.0/execution-broker.yaml \
schema/build/execution-broker-1.0.4.yaml
Pass true to clean the build directory first:
buildschema true
The installgenerator function downloads the OpenAPI Generator CLI jar to
/opt/openapi-generator/ if it is not already present.
installgenerator
This is equivalent to:
mkdir -p /opt/openapi-generator
wget \
https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar \
--output-document /opt/openapi-generator/openapi-generator-cli-7.18.0.jar
The buildjavaspring function builds and installs the calycopis-spring Maven
artifact into the local Maven repository. The Calycopis-broker project depends on
this artifact (net.ivoa.calycopis:calycopis-spring:1.0.4-SNAPSHOT).
The Maven POM uses the openapi-generator-maven-plugin to generate classes from
the processed schema at build time, so Step 2 must be completed first.
buildjavaspring
This is equivalent to:
pushd codegen/java/spring/
./mvnw clean install
popd
Generated sources are written to:
codegen/java/spring/target/generated-sources/openapi/
The buildjavaclient function builds and installs the calycopis-client Maven
artifact into the local Maven repository.
buildjavaclient
This is equivalent to:
pushd codegen/java/client/
./mvnw clean install
popd
The buildpythonclient function uses the OpenAPI Generator CLI to generate
the Python client, copies the hand-written wrapper layer into the generated
package, and builds it.
buildpythonclient
This is equivalent to:
rm -rf codegen/python/client/build
mkdir -p codegen/python/client/build
java -jar /opt/openapi-generator/openapi-generator-cli-7.18.0.jar \
generate \
--generator-name python \
--input-spec schema/build/execution-broker-1.0.4.yaml \
--output codegen/python/client/build \
--additional-properties "projectName=calycopis-client" \
--additional-properties "packageName=calycopis_client" \
--additional-properties "packageUrl=https://github.com/ivoa/Calycopis-schema" \
--additional-properties "packageVersion=1.0.4"
cp -r codegen/python/client/wrappers \
codegen/python/client/build/calycopis_client/wrappers
pip install twine build
python -m build codegen/python/client/build
To make the generated Python client available in the development environment:
pip install --editable codegen/python/client/build
To build everything from scratch:
source bin/buildscripts.sh
buildschema true
installgenerator
buildjavaspring
buildjavaclient
buildpythonclient
pip install --editable codegen/python/client/build
The current schema version is 1.0.4. This version string appears in:
bin/buildscripts.sh(schemaversionvariable)project.properties- The Maven POM files (
<version>1.0.4-SNAPSHOT</version>) - The generated Python package (
packageVersion) - The processed schema output filename (
execution-broker-1.0.4.yaml)
- Generator:
openapi-generator-maven-pluginv7.14.0 (embedded in Maven POM) - Model name prefix:
Ivoa(all generated model classes are prefixed, e.g.IvoaSimpleComputeResource) - API package:
net.ivoa.calycopis.spring.api - Model package:
net.ivoa.calycopis.spring.model - Uses the
delegatePatternfor Spring controller delegation - Date mappings:
DateTime→java.time.Instant,Date→java.util.Date
- Generator:
openapi-generator-maven-plugin(embedded in Maven POM) - Model name prefix:
Ivoa - API package:
net.ivoa.calycopis.client.api - Model package:
net.ivoa.calycopis.client.model
- Generator: OpenAPI Generator CLI 7.18.0 (standalone jar)
- Package name:
calycopis_client - Includes a hand-written wrapper layer at
calycopis_client/wrappers/providing a higher-levelExecutionBrokerClientclass for submitting offer-set requests, polling session phases, and updating sessions.