acme-portal-sdk
SDK to provide data and actions for acme-portal VSCode extension.
Rather than embedding a pre-defined logic in acme-portal extension, the SDK
allows to define sources of data and behaviour for extension functionality. As such, the extension servers as UI layer to the implementation provided by SDK objects.
Problem
A repeatable source of pain while working on software is that deployment processes are highly specific to a given project. While the application may be written in a well known language or framework, the deployment process is usually specialized to a given application, team and company making it difficult for new and existing team members to understand how to just "ship" their code.
acme-portal and acme-portal-sdk attempt to address that problem by proposing a standard UI & workflow of deploying a python application.
However, rather than dictating an exact deployment implementation, the two packages jointly define only high level deployment concepts and allow users to customize the implementation.
In a way, they attempt to make the deployment process as frictionless and intuitive as possible, without simplifying the deployment to a restrained set of practices.
acme-portal-sdk provides a specific implementation of a deployment process for a python application based on prefect orchestration library, however users of the SDK can easily extend the interfaces to their projects. Some standard implementation schemes like one based on e.g. airflow can be made part of SDK in the future.
Concepts
To the end of clarifying deployment process, the SDK defines the following concepts:
Flow- (often named in various frameworks asWorkflow/Job/DAG) is a unit of work in an application. It can also be though of as anexecutable scriptorentrypoint. AFlowcan have sub-elements likeSteps/Tasks/Nodes, but those are not tracked by the SDK. Flows form a basis of what unit of computation is deployed. In this way an application is composed of multiple relatedFlowsmaintained by the team, with a desire to deploy them independently of each other.Deployment- is a piece of configuration defined in an execution environment (e.g.Prefect/AirflowServer, a remote server, some AWS Resources) that defines how to run a unit of work (aFlow).Deploymentis then capable of orchestrating physical resources (by e.g. submitting requests, having execute permissions) and generally use environment resources to perform computation.Environment- (sometimes calledNamespace,Version,Label) is a persistent identifier of an application version run in a givenDeployment. PopularEnvironmentnames used aredev,tst,uat,prod. Environment names are useful to communicate state of a given feature (and its code changes) in an application release cycle: "those changes are indevonly", "this feature needs to be tested inuat", etc.
Having those concepts defined the SDK defines the following actions:
Find Flows- scan codebase or configration to findFlowswhich can be deployedFind Deployments- find existingFlowdeployment informationDeploy- uses information about theFlowtogether with additional deployment configuration to create aDeploymentin an initial, starting environment (e.g.dev).Promote- having completed required validation steps on deployment outputs in a given environment, the code version used in sourceDeploymentcan be deployed to a target environment (e.g. fromdevtouat)
The acme-portal VSCode extension then displays flow and deployment infromation and provides UI elements (buttons) / VSCode tasks to trigger Deploy and Promote actions.
For explanation on how to configure your project to work with acme-portal using the SDK, checkout Configuring SDK for your project
For explanation of the features provided by default prefect based implementation checkout Default functionality of prefect based implementation
See guide Using default prefect based functionality for how to configure your project to work with acme-portal using the default prefect based implementation.
Python environment
The project comes with a python development environment. To generate it, after checking out the repo run:
chmod +x create_env.sh
Then to generate the environment (or update it to latest version based on state of uv.lock), run:
./create_env.sh
This will generate a new python virtual env under .venv directory. You can activate it via:
source .venv/bin/activate
If you are using VSCode, set to use this env via Python: Select Interpreter command.
Project template
This project has been setup with acme-project-create, a python code template library.
Required setup post use
-
Enable GitHub Pages to be published via GitHub Actions by going to
Settings-->Pages-->Source -
Create
release-pypienvironment for GitHub Actions to enable uploads of the library to PyPi. Set protections on what tags can deploy to this environment (Point 10). Set it to tags following patternv*. -
Setup auth to PyPI for the GitHub Action implemented in
.github/workflows/release.ymlvia Trusted Publisheruv publishdoc -
Once you create the python environment for the first time add the
uv.lockfile that will be created in project directory to the source control and update it each time environment is rebuilt -
In order not to replicate documentation in
docs/docs/index.mdfile andREADME.mdin root of the project setup a symlink fromREADME.mdfile to theindex.mdfile. To do this, fromdocs/docsdir run:ln -sf ../../README.md index.md -
Run
pre-commit installto install the pre-commit hooks.
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 acme_portal_sdk-0.0.6.tar.gz.
File metadata
- Download URL: acme_portal_sdk-0.0.6.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4be101303e836f6e444eddf0a35aba04e48ef0e31fa4536ebf2c4ed8fab10075
|
|
| MD5 |
72d68f15323c897e991f785f7ab0f331
|
|
| BLAKE2b-256 |
a6051ac102463fe22a7a309265b9f0e57a5bf752b5f8e4721a0bcb13e8479ea8
|
File details
Details for the file acme_portal_sdk-0.0.6-py3-none-any.whl.
File metadata
- Download URL: acme_portal_sdk-0.0.6-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f1e9d9821b4b4cd49c395a355c0fb135a93b24278316359385d4d5201aac985
|
|
| MD5 |
e0b3cd8245d76beda224151bb3d3a875
|
|
| BLAKE2b-256 |
eb4f05cd25dbb4a1d1d3f71f6b69a6b3dc944f15598d4a88e1c26915b68eadee
|