![]() |
STASIS
A pipeline delivery generator
|
#include <string.h>#include <stdbool.h>#include "artifactory.h"#include "docker.h"#include "environment.h"#include "ini.h"#include "multiprocessing.h"
Go to the source code of this file.
Data Structures | |
| struct | Content |
| struct | Test |
| An array of tests. More... | |
| struct | Delivery |
| A structure describing a full delivery object. More... | |
| struct | Delivery::STASIS_INI_FP |
| Container for INIFILE handles. More... | |
| struct | Delivery::System |
| System information. More... | |
| struct | Delivery::Storage |
| Storage paths. More... | |
| struct | Delivery::Meta |
| Metadata related to the delivery. More... | |
| struct | Delivery::Info |
| Release information (name & datetime) More... | |
| struct | Delivery::Conda |
| Conda configuration. More... | |
| struct | Delivery::Runtime |
| Global runtime variables. More... | |
| struct | Delivery::Tests |
| struct | Delivery::Deploy |
| struct | Delivery::Deploy::JFrog |
| struct | Delivery::Deploy::Docker |
| struct | Delivery::Rule |
Functions | |
| int | delivery_init (struct Delivery *ctx, int render_mode) |
| void | delivery_free (struct Delivery *ctx) |
| void | delivery_meta_show (struct Delivery *ctx) |
| void | delivery_conda_show (struct Delivery *ctx) |
| void | delivery_tests_show (struct Delivery *ctx) |
| void | delivery_runtime_show (struct Delivery *ctx) |
| int | delivery_build_recipes (struct Delivery *ctx) |
| struct StrList * | delivery_build_wheels (struct Delivery *ctx) |
| int | delivery_index_wheel_artifacts (struct Delivery *ctx) |
| char * | delivery_get_release_header (struct Delivery *ctx) |
| void | delivery_rewrite_spec (struct Delivery *ctx, char *filename, unsigned stage) |
| int | delivery_copy_wheel_artifacts (struct Delivery *ctx) |
| int | delivery_copy_conda_artifacts (struct Delivery *ctx) |
| int | delivery_get_conda_installer (struct Delivery *ctx, char *installer_url) |
| void | delivery_get_conda_installer_url (struct Delivery *ctx, char *result, size_t maxlen) |
| int | delivery_install_packages (struct Delivery *ctx, char *conda_install_dir, char *env_name, int type, struct StrList *manifest[]) |
| int | delivery_index_conda_artifacts (struct Delivery *ctx) |
| void | delivery_tests_run (struct Delivery *ctx) |
| void | delivery_defer_packages (struct Delivery *ctx, int type) |
| void | delivery_conda_enable (struct Delivery *ctx, char *conda_install_dir) |
| void | delivery_install_conda (char *install_script, char *conda_install_dir) |
| int | delivery_format_str (struct Delivery *ctx, char **dest, size_t maxlen, const char *fmt) |
| int | delivery_gather_tool_versions (struct Delivery *ctx) |
| int | delivery_init_tmpdir (struct Delivery *ctx) |
| void | delivery_init_dirs_stage1 (struct Delivery *ctx) |
| void | delivery_init_dirs_stage2 (struct Delivery *ctx) |
| int | delivery_init_platform (struct Delivery *ctx) |
| int | delivery_init_artifactory (struct Delivery *ctx) |
| int | delivery_artifact_upload (struct Delivery *ctx) |
| int | delivery_mission_render_files (struct Delivery *ctx) |
| int | delivery_docker (struct Delivery *ctx) |
| int | delivery_fixup_test_results (struct Delivery *ctx) |
| int | bootstrap_build_info (struct Delivery *ctx) |
| int | delivery_dump_metadata (struct Delivery *ctx) |
| int | populate_info (struct Delivery *ctx) |
| int | populate_delivery_cfg (struct Delivery *ctx, int render_mode) |
| int | populate_delivery_ini (struct Delivery *ctx, int render_mode) |
| int | populate_mission_ini (struct Delivery **ctx, int render_mode) |
| void | validate_delivery_ini (struct INIFILE *ini) |
| int | filter_repo_tags (char *repo, struct StrList *patterns) |
| int | delivery_exists (struct Delivery *ctx) |
| int | delivery_overlay_packages_from_env (struct Delivery *ctx, const char *env_name) |
| int | delivery_conda_enforce_package_version (struct Delivery *ctx, const char *env_name, const char *name) |
| int | delivery_series_sync (struct Delivery *ctx) |
| int | delivery_purge_packages (struct Delivery *ctx, const char *env_name, int use_pkg_manager) |
| void | delivery_export (const struct Delivery *ctx, char *envs[]) |
| void | delivery_rewrite_stage1 (struct Delivery *ctx, char *specfile) |
| void | delivery_rewrite_stage2 (struct Delivery *ctx, char *specfile) |
| struct Delivery * | delivery_duplicate (struct Delivery *ctx) |
| struct Tests * | tests_init (size_t num_tests) |
| int | tests_add (struct Tests *tests, struct Test *x) |
| void | test_free (struct Test **x) |
| void | tests_free (struct Tests **x) |
| struct Test * | test_init () |
| int delivery_build_recipes | ( | struct Delivery * | ctx | ) |
| void delivery_conda_enable | ( | struct Delivery * | ctx, |
| char * | conda_install_dir ) |
| int delivery_conda_enforce_package_version | ( | struct Delivery * | ctx, |
| const char * | env_name, | ||
| const char * | name ) |
Conda does not handle version suffixes well, if at all. For example, if pkg-1.2.3rc1 is installed Conda will silently ignore a request to install pkg-1.2.3. This function serves as a workaround by comparing the version on-disk, and the requested version from the package list, and if the versions are not equal the on-disk package is replaced by the one in the package list.
When a package is present in the list without a pinned version it will be reinstalled with whatever is available

| void delivery_conda_show | ( | struct Delivery * | ctx | ) |
| int delivery_copy_conda_artifacts | ( | struct Delivery * | ctx | ) |
Copy built Conda packages to artifact storage
| ctx | poitner to Delivery context |
| int delivery_copy_wheel_artifacts | ( | struct Delivery * | ctx | ) |
Copy compiled wheels to artifact storage
| ctx | pointer to Delivery context |
| void delivery_defer_packages | ( | struct Delivery * | ctx, |
| int | type ) |
Determine which packages are to be installed directly from conda or pip, and which packages need to be built locally
| ctx | pointer to Delivery context |
| type | DEFER_CONDA (filter conda packages) |
| type | DEFER_PIP (filter python packages) |

Return a copy of a delivery context
| ctx | Delivery context |

| int delivery_exists | ( | struct Delivery * | ctx | ) |
Determine whether a release on-disk matches the release name in use
| ctx | Delivery context |

| void delivery_export | ( | const struct Delivery * | ctx, |
| char * | envs[] ) |
Export delivery environments
| ctx | Delivery context |
| envs | array of conda environment names |
| int delivery_format_str | ( | struct Delivery * | ctx, |
| char ** | dest, | ||
| size_t | maxlen, | ||
| const char * | fmt ) |
Generate a formatted release string
Formatters:
%n = Delivery Name%c = Delivery Codename (HST mission, only)%m = Mission%R = Delivery Revision number (or "final")%r = Delivery Revision number%v = Delivery Version%P = Python version (i.e. 3.9.1)%p = Compact Python version (i.e. 3.9.1 -> 39)%a = System architecture name%o = System platform name%t = Delivery timestamp (Unix Epoch)| ctx | pointer to Delivery context |
| dest | NULL pointer to string, or initialized string |
| maxlen | |
| fmt | release format string |
| void delivery_free | ( | struct Delivery * | ctx | ) |
Free memory allocated by delivery_init()
| ctx | pointer to Delivery context |

| int delivery_get_conda_installer | ( | struct Delivery * | ctx, |
| char * | installer_url ) |
Retrieve Conda installer
| ctx | pointer to Delivery context |
| installer_url | URL to installation script |

| void delivery_get_conda_installer_url | ( | struct Delivery * | ctx, |
| char * | result, | ||
| size_t | maxlen ) |
| char * delivery_get_release_header | ( | struct Delivery * | ctx | ) |
Generate a header block that is applied to delivery artifacts
| ctx | pointer to Delivery context |
| int delivery_index_conda_artifacts | ( | struct Delivery * | ctx | ) |
Update "conda index" on Conda artifact storage
| ctx | pointer to Delivery context |
| int delivery_index_wheel_artifacts | ( | struct Delivery * | ctx | ) |
Copy wheel packages to artifact storage
| ctx | pointer to Delivery context |

| int delivery_init | ( | struct Delivery * | ctx, |
| int | render_mode ) |
Initializes a Deliver structure
| ctx | pointer to Delivery context |
| render_mode | INI_READ_RAW or INI_READ_RENDER |
0 on success 
| void delivery_install_conda | ( | char * | install_script, |
| char * | conda_install_dir ) |
Install Conda
| install_script | path to Conda installation script |
| conda_install_dir | path to install Conda |

| int delivery_install_packages | ( | struct Delivery * | ctx, |
| char * | conda_install_dir, | ||
| char * | env_name, | ||
| int | type, | ||
| struct StrList * | manifest[] ) |
Install packages based on Delivery context
| void delivery_meta_show | ( | struct Delivery * | ctx | ) |
| int delivery_purge_packages | ( | struct Delivery * | ctx, |
| const char * | env_name, | ||
| int | use_pkg_manager ) |
Remove packages from an environment
| ctx | Delivery context |
| env_name | Name of conda environment |
| use_pkg_manager | PKG_USE_PIP |
| use_pkg_manager | PKG_USE_CONDA |

| void delivery_rewrite_spec | ( | struct Delivery * | ctx, |
| char * | filename, | ||
| unsigned | stage ) |
Finalizes a delivery artifact for distribution
| ctx | poitner to Delivery context |
| filename | path to delivery artifact (Conda YAML file) |
| stage | DELIVERY_REWRITE_SPEC_STAGE_1 - Replacements for build |
| stage | DELIVERY_REWRITE_SPEC_STAGE_2 - Replacements for export |

| void delivery_rewrite_stage1 | ( | struct Delivery * | ctx, |
| char * | specfile ) |
STAGE 1: Rewrite delivery-related strings in specfile
| ctx | Delivery context |
| specfile | path to YAML spec file |

| void delivery_rewrite_stage2 | ( | struct Delivery * | ctx, |
| char * | specfile ) |
STAGE 2: Rewrite delivery-related strings in specfile
| ctx | Delivery context |
| specfile | path to YAML spec file |

| void delivery_runtime_show | ( | struct Delivery * | ctx | ) |
| int delivery_series_sync | ( | struct Delivery * | ctx | ) |
Retrieve remote deliveries associated with the current version series
| ctx | Delivery context |

| void delivery_tests_run | ( | struct Delivery * | ctx | ) |
| void delivery_tests_show | ( | struct Delivery * | ctx | ) |
| int tests_add | ( | struct Tests * | tests, |
| struct Test * | x ) |
Add a Test structure to Tests
| tests | list to add to |
| x | test to add to list |
| void tests_free | ( | struct Tests ** | x | ) |
Free a Tests structure
| x | pointer to Tests |
| struct Tests * tests_init | ( | size_t | num_tests | ) |
Initialize a Tests structure
| num_tests | number of test records |
Tests structure