Skip to main content

CLI app to set up micro services of Helmholtz Knowledge Graph locally

Project description

Docs Test Coverage

hkg-cli

A command-line interface tool for setting up and managing Helmholtz Knowledge Graph (HKG) development environments. hkg-cli provides a streamlined way to initialize, configure, and run HKG components with minimal setup effort.

Key Features

  • 🚀 Quick Setup: Initialize a complete HKG development environment with a single command
  • 🔧 Configuration Management: Easy configuration through TOML files
  • 🐳 Docker Integration: Automated Docker Compose setup for all HKG components
  • 🔄 Component Updates: Simple commands to update and manage HKG components
  • 🛠️ Development Tools: Built-in utilities for common development tasks
  • 🔒 Private Components: Support for private and devops repositories
  • 📝 Rich Logging: Enhanced logging with debug options

Why hkg-cli?

  • Simplified Development: Reduces the complexity of setting up HKG development environments
  • Standardized Setup: Ensures consistent development environments across teams
  • Time Saving: Automates repetitive setup tasks and configuration
  • Easy Maintenance: Streamlined process for updating and managing HKG components

Installation

This project works with Python > 3.9.

pip install git+ssh://git@codebase.helmholtz.cloud/hmc/hmc-public/unhide/development/hkg-cli.git

Or, you can install via pypi registry.

pip install hkg-cli

Getting Started

  1. Initialize a new HKG project:
hkg-cli setup init my-hkg-project [--private] [--devops]

The my-hkg-project folder will be created to hold all component repositories. This folder will contain:

  • Individual component repositories as subdirectories with environment files
  • Configuration file
  • Docker compose files

!!! warning "SSH Key Requirements" To use private or devops repositories, you must: 1. Have SSH access to the Helmholtz GitLab instance 2. Have your SSH key properly configured 3. Have access permissions to the private repositories 4. Use the --private flag for private repositories 5. Use the --devops flag for devops repositories

If you don't have the required SSH access, the initialization will fail when trying to clone private repositories.

Options:

  • --private: Enable cloning of private repositories (requires SSH access)
  • --devops: Enable cloning of devops repositories (requires SSH access)
  1. Start the development environment:
hkg-cli run
  1. Stop the environment when done:
hkg-cli stop [--clear]

Options:

  • --clear: Clear all volumes and networks in docker
  1. Update components:
hkg-cli setup update

The update command will:

  • Apply changes made in hkg-config.toml to the environment
  • Update Docker compose file based on configuration changes
  • Update environment variables for components
  • Pull latest changes if repository versions/branches/commits are modified
  • Disable components in Docker compose if enabled=false is set

!!! tip "Configuration Changes" You can modify the hkg-config.toml file to: - Change component versions/branches/commits - Enable/disable components (set enabled=false to disable) - Update environment variables - Modify component configurations

Run `hkg-cli setup update` to apply these changes.
  1. Show version:
hkg-cli --version
  1. Enable debug logging:
hkg-cli --debug [command]

For more detailed usage instructions, please refer to our documentation.

Troubleshooting

When I try installing the package, I get an IndexError: list index out of range

Make sure you have pip > 21.2 (see pip --version), older versions have a bug causing this problem. If the installed version is older, you can upgrade it with pip install --upgrade pip and then try again to install the package.

SSH Access Issues

If you encounter SSH-related errors during initialization:

  1. Verify your SSH key is properly configured:

    ssh -T git@codebase.helmholtz.cloud
    
  2. Ensure you have access to the required repositories:

    • Check your GitLab permissions
    • Contact your project administrator if needed
  3. If using a custom SSH key, make sure it's added to your SSH agent:

    ssh-add ~/.ssh/your_private_key
    

You can find more information on using and contributing to this repository in the documentation.

How to Cite

If you want to cite this project in your scientific work, please use the citation file in the repository.

Acknowledgements

We kindly thank all authors and contributors.

HMC Logo    FZJ Logo

This project was developed at the Institute for Materials Data Science and Informatics (IAS-9) of the Jülich Research Center and funded by the Helmholtz Metadata Collaboration (HMC), an incubator-platform of the Helmholtz Association within the framework of the Information and Data Science strategic initiative.

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

hkg_cli-0.1.0.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

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

hkg_cli-0.1.0-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file hkg_cli-0.1.0.tar.gz.

File metadata

  • Download URL: hkg_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for hkg_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9186815e033d9efb19a60a13765633522c2be8fad891ff027a2a015939448b4f
MD5 00017ff7236d22d88cdd048cf00eedea
BLAKE2b-256 155135d02e28f5661e396bbe0edc6933d365455e45e7615d1e4f471af987c30b

See more details on using hashes here.

File details

Details for the file hkg_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hkg_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for hkg_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81df4d27193fbef01cfa619fa63569dd947d62fbb20af24b2c8dd4c6e6797975
MD5 25a038638cb17ed80056ee6886088686
BLAKE2b-256 8f44685a2ad8c411d30b21b0d16dbaafed17f3226a680949364520e23bd1cd5b

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