CLI app to set up micro services of Helmholtz Knowledge Graph locally
Project description
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
- 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)
- Start the development environment:
hkg-cli run
- Stop the environment when done:
hkg-cli stop [--clear]
Options:
--clear: Clear all volumes and networks in docker
- Update components:
hkg-cli setup update
The update command will:
- Apply changes made in
hkg-config.tomlto 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=falseis 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.
- Show version:
hkg-cli --version
- 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:
-
Verify your SSH key is properly configured:
ssh -T git@codebase.helmholtz.cloud
-
Ensure you have access to the required repositories:
- Check your GitLab permissions
- Contact your project administrator if needed
-
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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9186815e033d9efb19a60a13765633522c2be8fad891ff027a2a015939448b4f
|
|
| MD5 |
00017ff7236d22d88cdd048cf00eedea
|
|
| BLAKE2b-256 |
155135d02e28f5661e396bbe0edc6933d365455e45e7615d1e4f471af987c30b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81df4d27193fbef01cfa619fa63569dd947d62fbb20af24b2c8dd4c6e6797975
|
|
| MD5 |
25a038638cb17ed80056ee6886088686
|
|
| BLAKE2b-256 |
8f44685a2ad8c411d30b21b0d16dbaafed17f3226a680949364520e23bd1cd5b
|