Creating a QCrBox Application Container#
This short guide shows you how to create a new QCrBox application container, which will provide a new application directory and initial boilerplate files for configuring, launching, and handling a container within QCrBox. Following this tutorial, you can then amend these files to support either a new non-interactive application or an interactive application (which both have tutorials), which can be called from within QCrBox as a command.
Prerequisites#
Before starting, ensure your development environment is set up following the guide located here, and that you have devbox shell running in your terminal. In addition, it's likely helpful to bring yourself up to speed on the platform's Technical Reference documentation, in particular Architecture & key components.
Initial Setup#
To begin, initialize a new QCrBox container for our module:
- Open your terminal and change directory to the directory where you have installed QCrBox.
- Start a Devbox shell using
devbox shell. - Type
qcb initfollowed by the name of the container you wish to create (e.g.qcb init cod_check_tutorial) and press Enter. - You will be prompted to provide basic information about your application through a guided dialogue. Follow the prompts to complete the setup (the inputs given here are only shown as an example):
Please provide some basic information about your application.
The following dialog will guide you through the relevant settings.
[1/7] Select application_type
1 - Non-interactive Command
2 - Interactive GUI (Linux)
3 - Interactive GUI (Windows)
Choose from [1/2/3] (1):
[2/7] application_slug (cod_check_tutorial):
[3/7] application_name (Cod Check): COD Check Tutorial
[4/7] application_version (x.y.z): 0.0.1
[5/7] description (Brief description of the application.): Can be used to check whether there is a similar structure in the crystallographic open database and output similar structures.
[6/7] url (): https://my.official.module.url
[7/7] email (): module_contact@university.somewhere
Created scaffolding for new application in 'T:\QCrBox_location\services\applications\cod_check_tutorial'.
Understanding the Generated Scaffolding#
Navigate to the application's folder to see the boilerplate files generated by qcb init. You'll find:
docker-compose.cod_check_tutorial.*.yml: Docker Compose files, typically unchanged for non-GUI applications.Dockerfile: Contains instructions to build the container.config_cod_check_tutorial.yaml: This defines the exposed functions as QCrBox "commands". At the moment, it contains example commands for a non-interactive sleep function and an interactive GUI session, but we'll replace these to specify QCrBox commands for our Python code.configure_cod_check_tutorial.py: Here, we'll implement our module's functionality and register it with QCrBox.
What Next?#
Once you have created a new QCrBox application container, you can amend the service to either:
- Support a non-interactive application - see the non-interactive tutorial here.
- Support an interactive (graphical user interface) application - (see the interactive tutorial here)