arrow-left

All pages
gitbookPowered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Config

Instant config describes which packages to make available in the CLI and a set of profiles which allow you to easily operate on a group of packages and apply env var files to configure then.

To generate a config file use the ./instant project generate command.

A single file may be used for configuration

circle-exclamation

The config.yml file should be located at the root of the project, or pointed to using the --config-file command

A reference config file looks like this:

  • projectName - gives this project configuration a name

  • image - defines the Docker image to use during deployment. This image should container the packages you wish to launch if you are not using customPackages. A default image with no packages included can be found at openhie/package-base:latest

  • logPath - gives a location to put log of the CLI output, useful for debugging

circle-info
  • Packages listed in a profile must be specified in either the customPackages or packages section

hashtag
Launching individual packages

Once a config has been defined with 1 or more packages, you may launch or stop packages by using the .

hashtag
Launching a profile

If you want to launch all the packages listed in a profile with the specified configuration and env vars applied, use the .

hashtag
Launching entire projects

Instead of individual packages, you can also launch everything define in your project config by using the .

hashtag
Changing the default banner displayed in the CLI

The CLI banner refers to the uppermost display when running the CLI. This banner may be overwritten by including a banner.txt file at the root of the project that includes the new banner in ascii format. A tool that may be used to generate this banner may be found

packages - lists the package ids that you expect to exist in the image

  • customPackages - lists packages that are not in the image. The path can either point to a file system location or a github url.

  • profiles - lists a number of profiles that are defind for this project. A profile is a group of packages, config and env var files that can be operated on (i.e. launched) together.

    • name - a profile name

    • packages - list of package ids that form part of this profile

    • envFiles - a lsit of env var file to apply when operating on these packages to configure then to do what you want

    • dev - launches the profile is dev mode, which is an instruction to packages to start in dev mode which usually mean to expose more ports than they usually would for development and debugging reasons

    • only - instructs the profile to operate on only the packages listed and any package dependencies will be ignored.

  • ./instant package <init|up|down|remove> -n <package_id> command
    ./instant package <init|up|down|remove> -p <profile_name> command
    ./instant project <init|up|down|remove> command
    herearrow-up-right
    projectName: platform
    image: jembi/platform
    logPath: /tmp/logs
    
    packages:
        - <<package-id>>
    
    customPackages:
        - id: <<custom-package-id>>
          path: <<custom-package-path>>
    
    profiles:
        - name: <<profile-name>>
          packages:
            - <<profile-package-id-1>>
            - <<profile-package-id-2>>
          envFiles:
            - <<env-file-1>>
            - <<env-file-2>>
          dev: false
          only: false

    CLI reference

    The CLI is supported for Linux and MacOS

    hashtag
    Usage

    circle-info

    The CLI must be named 'instant-linux' for Linux, and 'instant-macos' for MacOS for autocomplete to work

    hashtag
    Main Commands

    hashtag
    Sub Commands

    hashtag
    package

    The package sub command includes commands:

    The package level commands, as shown, are there to control packages within a project, as well as generate the skeleton for a new package.

    Each of these sub commands accept the following flags:

    E.g. ./instant package init -n interoperability-layer-openhim

    For information about flags associated to any one of the package commands, do instant-linux package [command] --help

    circle-info

    After generating a new package, remember to add the package ID to the config file

    circle-exclamation
    • Packages in a project can only be started if included in the config file

    • Command line arguments like --dev and --only will overwrite those specified in the config file profiles when using that particular profile

    hashtag
    project

    The project sub command includes commands:

    The project level commands, as shown, are there to simultaneously perform commands on all packages in a project, as well as generate the config file for a new project, in the desired format.

    Each of these sub commands accept the following flags:

    For information about flags associated to any one of the project commands, do instant-linux project [command] --help

    hashtag
    completion

    The completion sub command includes commands:

    The project level commands, as shown, are there to enable autocomplete for the specified shell.

    circle-exclamation

    Remember to reload your shell after generating the autocomplete script

  • Env vars in --profile env var files are appended to by env var files specified in the command line, or overwritten by the command line env var files if there are conflicting env vars

  • Custom packages in a profile must be specified in the customPackages section of the config file

  • completion    Generate the autocompletion script for the specified shell
    package       Package level commands
    project       Project level commands
    help          Help about any command
    init          Initialize a package with relevant configs, volumes and setup
    up            Stand a package back up after it has been brought down
    down          Bring a package down without removing volumes or configs
    remove        Remove everything related to a package (volumes, configs, etc)
    generate      Generate a new package
    Flags:
          --config string         config file (default is $WORKING_DIR/config.yaml)
      -c, --custom-path strings   Path(s) to custom package(s)
      -d, --dev dev               For development related functionality (Passes dev as the second argument to your swarm file)
          --env-file strings      env file
      -e, --env-var strings       Env var(s) to set or overwrite
      -h, --help                  help for down
      -n, --name strings          The name(s) of the package(s)
      -o, --only                  Ignore package dependencies
      -p, --profile string        The profile name to load parameters from (defined in config.yml)
    init          Initialize all packages in a project
    up            Up all packages in the project
    down          Down all packages in the project
    destroy       Destroy all packages in the project
    generate      Generate a new project
    Flags:
          --config string         config file (default is $WORKING_DIR/config.yaml)
      -c, --custom-path strings   Path(s) to custom package(s)
      -d, --dev dev               For development related functionality (Passes dev as the second argument to your swarm file)
          --env-file strings      env file
      -e, --env-var strings       Env var(s) to set or overwrite
      -h, --help                  help for destroy
      -o, --only                  Ignore package dependencies
    bash          Generate the autocompletion script for bash
    zsh           Generate the autocompletion script for zsh

    Get Started

    The following section explain the technical detail on how to get started with Instant OpenHIE and how to configure what you want to get deployed.

    Quick start

    Prerequisites:

    • Install docker

      • On linux: install the docker packagearrow-up-right

      • On OSX or Windows:

    • Enable swarm mode in docker: docker swarm init

    To get started with Instant OpenHIE you will first need to download the CLI tool. The binary may be download via the terminal with the following url based on your operating system

    Download the binary

    Grant the binary executable permissions

    Download the binary

    Grant the binary executable permissions

    Ensure docker desktop is using the default context else Instant won't be able to run docker containers

    For Windows it is recommend to install the

    To test that the binary works, run the executable with no commands to see the help text.

    Next, you would want to configure which packages Instant can deploy for your particular needs.

    Instant doesn't ship with any default packages to deploy. Packages are expected to be created by the community and in time there will be many option available. Jembi has curated a set of packages that we commonly use to help implementer to get started with a foundational set of health information exchange components. To get started with that pre-configured package set, see the .

    Otherwise, you may create your own config for your . Continue to config section to find out how.

    tools and install an Ubuntu vm. From there continue to follow the linux instructions. Ensure that you have
    for your WSL instance.
    Install docker desktoparrow-up-right
    WSLarrow-up-right
    OpenHIM Platform docsarrow-up-right
    own set of packages
    sudo curl -L https://github.com/openhie/instant-v2/releases/latest/download/instant-linux -o /usr/local/bin/instant
    sudo chmod +x /usr/local/bin/instant
    sudo curl -L https://github.com/openhie/instant-v2/releases/latest/download/instant-macos -o /usr/local/bin/instant
    sudo chmod +x /usr/local/bin/instant
    docker context use default
    $ instant
    A cli to assist with package deployment and management
    
    Usage:
      cli [command]
    
    Available Commands:
      completion  Generate the autocompletion script for the specified shell
      help        Help about any command
      package     Package level commands
      project     Project level commands
      version     Print the CLI version
    
    Flags:
      -h, --help   help for cli
    
    Use "cli [command] --help" for more information about a command.
    Docker Desktop support enabledarrow-up-right