Ghga Transpiler
GHGA-Transpiler - a short description
Description
This repo is a template for creating a new microservice.
The directories, files, and their structure herein are recommendations from the GHGA Dev Team.
Naming Conventions
The github repository contains only lowercase letters, numbers, and hyphens "-",
e.g.: my-microservice
The python package (and thus the source repository) contains underscores "_"
instead of hyphens, e.g.: my_microservice
However, an abbreviated version is prefered as package name.
Adapt to your service
This is just a template and needs some adaption to your specific use case.
Please search for "please adapt" comments. They will indicate all locations that need modification. Once the adaptions are in place, please remove these # comments.
Finally, follow the instructions to generate the README.md described in
./readme_generation.md. Please also adapt this markdown file
by providing an overview of the feature of the package.
Installation
We recommend using the provided Docker container.
A pre-build version is available at docker hub:
docker pull ghga/ghga-transpiler:1.0.0
Or you can build the container yourself from the ./Dockerfile:
# Execute in the repo's root dir:
docker build -t ghga/ghga-transpiler:1.0.0 .
For production-ready deployment, we recommend using Kubernetes, however, for simple use cases, you could execute the service using docker on a single server:
# The entrypoint is preconfigured:
docker run -p 8080:8080 ghga/ghga-transpiler:1.0.0 --help
If you prefer not to use containers, you may install the service from source:
# Execute in the repo's root dir:
pip install .
# To run the service:
ghga_transpiler --help
Configuration
Parameters
The service requires the following configuration parameters:
Usage:
A template YAML for configurating the service can be found at
./example-config.yaml.
Please adapt it, rename it to .ghga_transpiler.yaml, and place it into one of the following locations:
- in the current working directory were you are execute the service (on unix:
./.ghga_transpiler.yaml) - in your home directory (on unix:
~/.ghga_transpiler.yaml)
The config yaml will be automatically parsed by the service.
Important: If you are using containers, the locations refer to paths within the container.
All parameters mentioned in the ./example-config.yaml
could also be set using environment variables or file secrets.
For naming the environment variables, just prefix the parameter name with ghga_transpiler_,
e.g. for the host set an environment variable named ghga_transpiler_host
(you may use both upper or lower cases, however, it is standard to define all env
variables in upper cases).
To using file secrets please refer to the corresponding section of the pydantic documentation.
Architecture and Design:
This is a Python-based service following the Triple Hexagonal Architecture pattern. It uses protocol/provider pairs and dependency injection mechanisms provided by the hexkit library.
Development
For setting up the development environment, we rely on the devcontainer feature of vscode in combination with Docker Compose.
To use it, you have to have Docker Compose as well as vscode with its "Remote - Containers"
extension (ms-vscode-remote.remote-containers) installed.
Then open this repository in vscode and run the command
Remote-Containers: Reopen in Container from the vscode "Command Palette".
This will give you a full-fledged, pre-configured development environment including:
- infrastructural dependencies of the service (databases, etc.)
- all relevant vscode extensions pre-installed
- pre-configured linting and auto-formating
- a pre-configured debugger
- automatic license-header insertion
Moreover, inside the devcontainer, a convenience commands dev_install is available.
It installs the service with all development dependencies, installs pre-commit.
The installation is performed automatically when you build the devcontainer. However,
if you update dependencies in the ./setup.cfg or the
./requirements-dev.txt, please run it again.
License
This repository is free to use and modify according to the Apache 2.0 License.
Readme Generation
This readme is autogenerate, please see readme_generation.md
for details.
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 ghga_transpiler-1.0.0.tar.gz.
File metadata
- Download URL: ghga_transpiler-1.0.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc6ef5aa241d76eabc5a163835bebb1fcacdadab7564d49bd2ee73a6b00960fb
|
|
| MD5 |
9b8f63fd9dd4949ca37d6744b5c72d2d
|
|
| BLAKE2b-256 |
7e6989b3b0f497e7d7c0a44c35ec2aafefba0bace44fe20dfc263c457bc8323b
|
File details
Details for the file ghga_transpiler-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ghga_transpiler-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ae32155d6757bbc9f75ca236ca38efea219d65a1cc92fc53d7d87520f5804fb
|
|
| MD5 |
22aac6bd84a75a2081d0dea8840b1643
|
|
| BLAKE2b-256 |
579e14aa83ff7e92798c1621ae77ae59a4ddde4d39660a5b3569861d70a22539
|