Skip to main content

Generates an OGC compliant Unity application package using the Unity app-pack-generator.

Project description


logo

Unity Application Generator

Creates and registers a Unity OGC application package

app-pack-generator | unity-example-application

Features

  • Uses app-pack-generator to create CWL, application descriptor and Docker image
  • Can output Jupyter noteboook parameterization for debugging purposes
  • Pushes generated Docker image to a Docker registry
  • Pushes generated application package files to a Dockstore application registry

Requirements

Setup Instructions

Install from PyPi

pip install mdps-app-generator

Usage

Unity application generation is accomplished by using the build_ogc_app program. It uses a stateful architecture such as in other programs such as git where actions on a repository can be done in a series of steps. These steps are listed when running build_ogc_app --help.

usage: build_ogc_app [-h] [--state_directory STATE_DIRECTORY] {init,build_docker,push_docker,parameters,build_cwl,push_app_registry} ...

Unity Application Package Generator

positional arguments:
  {init,build_docker,push_docker,parameters,build_cwl,push_app_registry}
    init                Initialize a Git repository for use by this application. Creates a .unity_app_gen directory in the destination directory
    build_docker        Build a Docker image from the initialized application directory
    push_docker         Push a Docker image from the initialized application directory to a remote registry
    parameters          Display parsed notebook parameters
    build_cwl           Create OGC compliant CWL files from the repository and Docker image
    push_app_registry   Push CWL files to Dockstore application registry

options:
  -h, --help            show this help message and exit
  --state_directory STATE_DIRECTORY
                        An alternative location to store the application state other than .unity_app_gen

By default a state directory name .unity_app_gen is created in the repository the tool is targeting. Usually this is within the repository directory itself unless the --state_directory argument is used. This directory contains metadata information and generated files created by steps and needed for subsequent steps.

init

Before using the tool with a repository the state directory needs to be initialized:

usage: build_ogc_app init [-h] [-c CHECKOUT] source_repository [destination_directory]

positional arguments:
  source_repository     Directory or Git URL of application source files, default is current directory
  destination_directory
                        Directory where to check out source repository, default is a directory under the current subdirectory with same basename as the
                        source_repository

options:
  -h, --help            show this help message and exit
  -c CHECKOUT, --checkout CHECKOUT
                        Git hash, tag or branch to checkout from the source repository

This can be accomplished with an existing clone of a repository or the tool can clone the repository locally for you. If no directory is supplied the tool will assume you would like to initialize the current directory. When working interatively it is suggested to change to the directory you are working with and use the script from there. This simplifies program usage and does not require you to use the --state_directory argument on each call.

For example to initialize an repository and use it locally:

git clone https://github.com/unity-sds/unity-example-application.git
cd unity-example-application
build_ogc_app init

Or to have the tool clone and initialize the repository for you:

build_ogc_app init https://github.com/unity-sds/unity-example-application.git unity-example-application
cd unity-example-application

build_docker

The build_docker command does not require any additional arguments. It will utilize app-pack-generator and repo2docker, please see the documentation there for how to set up your repository for a successful build. The built Docker image name will be stored into app_state.json file in the state directory. This command requires the init step to have already been run.

push_docker

This command will push a Docker image built by the build_docker step to a remote Docker registry. It will then record the remote registry URL into the state directory for use by subsequent steps. The push_docker command has a required argument of either the URL of a remote Docker registry or a Dockerhub username. It is assumed you have already used docker login to initialze credentials. This command requires the build_docker step to have already been run.

build_cwl

The build_cwl will use app-pack-generator to create OGC compliant CWL files based on the parameterization of the Jupyter notebook in the target repository. Currently the Jupyter notebook is required to be named process.ipynb. Please see the app-pack-generator documentation for how to properly parameterize a notebook. The generated CWL files and application descriptor will be placed in the state directory. If the push_docker step has not yet been run the CWL files will refer to the local Docker image tag instead a remote URL.

push_app_registry

The push_app_registry command pushes the generated CWL into a Dockstore application registry server. It requires the the URL to the Dockstore API as well as a token obtained through the Dockstore interface. The build_cwl step is required to have already been executed.

usage: build_ogc_app push_app_registry [-h] --api_url DOCKSTORE_API_URL --token DOCKSTORE_TOKEN

options:
  -h, --help            show this help message and exit
  --api_url DOCKSTORE_API_URL
                        Dockstore API URL including the trailing api/ portion of the URL
  --token DOCKSTORE_TOKEN
                        Dockstore API token obtained from the My Services / Account page

The API URL can be obtained from the Dockstore user interface by scrolling to the bottom and clicking the API link in the footer. It will be the portion of the URL up to the /api path. The API token is obtained by logging into the Dockstore, clocking on the username drop down in the top right corner then selecting the Account item. Copy the token from the Dockstore Account item.

Changelog

See our CHANGELOG.md for a history of our changes.

See our releases page for our key versioned releases.

License

See our: LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdps_app_generator-1.2.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdps_app_generator-1.2.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file mdps_app_generator-1.2.0.tar.gz.

File metadata

  • Download URL: mdps_app_generator-1.2.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mdps_app_generator-1.2.0.tar.gz
Algorithm Hash digest
SHA256 241f24ab291ac33d9f0ca653be746aaeec9784ce5fa09bbce3e59a525680e51f
MD5 0ec8a47fc0f839498b0d6dc1776b624e
BLAKE2b-256 805e183ffc89e2a6fd50f4294ab198e68e317729dc44faf2ba802038f4959c6d

See more details on using hashes here.

File details

Details for the file mdps_app_generator-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mdps_app_generator-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 023d38b4d9be601816badf0c1e2c3f32776b97bf5394ff2600b0f0a6dcad2aae
MD5 cbd5e3bdb63804630d98cc57097f95d0
BLAKE2b-256 326848a0482b6dffde1a37a5b0034b2dd3a10aa61a4e1755c8fb31fc2e43e925

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page