diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..2ebeaa8 --- /dev/null +++ b/404.html @@ -0,0 +1,436 @@ + + + +
+ + + + + + + + + + + + + + +This Code of Conduct is our way to encourage good behavior and discourage bad behavior in our open source community. We invite participation from many people to bring different perspectives to support this project. We pledge to do our part to foster a welcoming and professional environment free of harassment. We expect participants to communicate professionally and thoughtfully during their involvement with this project.
+Participants may lose their good standing by engaging in misconduct. For example: insulting, threatening, or conveying unwelcome sexual content. We ask participants who observe conduct issues to report the incident directly to the project's Response Team at opensource-conduct@verizonmedia.com. Verizon Media will assign a respondent to address the issue. We may remove harassers from this project.
+This code does not replace the terms of service or acceptable use policies of the websites used to support this project. We acknowledge that participants may be subject to additional conduct terms based on their employment which may govern their online expressions.
+This Code of Conduct makes our expectations of participants in this community explicit. +* We forbid harassment and abusive speech within this community. +* We request participants to report misconduct to the project’s Response Team. +* We urge participants to refrain from using discussion forums to play out a fight.
+We expect participants in this community to conduct themselves professionally. Since our primary mode of communication is text on an online forum (e.g. issues, pull requests, comments, emails, or chats) devoid of vocal tone, gestures, or other context that is often vital to understanding, it is important that participants are attentive to their interaction style.
+Participants remain in good standing when they do not engage in misconduct or harassment. To elaborate: +* Don't be a bigot. Calling out project members by their identity or background in a negative or insulting manner. This includes, but is not limited to, slurs or insinuations related to protected or suspect classes e.g. race, color, citizenship, national origin, political belief, religion, sexual orientation, gender identity and expression, age, size, culture, ethnicity, genetic features, language, profession, national minority statue, mental or physical ability. +* Don't insult. Insulting remarks about a person’s lifestyle practices. +* Don't dox. Revealing private information about other participants without explicit permission. +* Don't intimidate. Threats of violence or intimidation of any project member. +* Don't creep. Unwanted sexual attention or content unsuited for the subject of this project. +* Don't disrupt. Sustained disruptions in a discussion. +* Let us help. Refusal to assist the Response Team to resolve an issue in the community.
+We do not list all forms of harassment, nor imply some forms of harassment are not worthy of action. Any participant who feels harassed or observes harassment, should report the incident. Victim of harassment should not address grievances in the public forum, as this often intensifies the problem. Report it, and let us address it off-line.
+If you experience or witness misconduct, or have any other concerns about the conduct of members of this project, please report it by contacting our Response Team at opensource-conduct@verizonmedia.com who will handle your report with discretion. Your report should include: +* Your preferred contact information. We cannot process anonymous reports. +* Names (real or usernames) of those involved in the incident. +* Your account of what occurred, and if the incident is ongoing. Please provide links to or transcripts of the publicly available records (e.g. a mailing list archive or a public IRC logger), so that we can review it. +* Any additional information that may be helpful to achieve resolution.
+After filing a report, a representative will contact you directly to review the incident and ask additional questions. If a member of the Verizon Media Response Team is named in an incident report, that member will be recused from handling your incident. If the complaint originates from a member of the Response Team, it will be addressed by a different member of the Response Team. We will consider reports to be confidential for the purpose of protecting victims of abuse.
+Verizon Media will assign a Response Team member with admin rights on the project and legal rights on the project copyright. The Response Team is empowered to restrict some privileges to the project as needed. Since this project is governed by an open source license, any participant may fork the code under the terms of the project license. The Response Team’s goal is to preserve the project if possible, and will restrict or remove participation from those who disrupt the project.
+This code does not replace the terms of service or acceptable use policies that are provided by the websites used to support this community. Nor does this code apply to communications or actions that take place outside of the context of this community. Many participants in this project are also subject to codes of conduct based on their employment. This code is a social-contract that informs participants of our social expectations. It is not a terms of service or legal contract.
+This text is shared under the CC-BY-4.0 license. This code is based on a study conducted by the TODO Group of many codes used in the open source community. If you have feedback about this code, contact our Response Team at the address listed above.
+ + + + + + + +First, thanks for taking the time to contribute to our project! The following information provides a guide for making contributions.
+By participating in this project, you agree to abide by the Verizon Media Code of Conduct. Everyone is welcome to submit a pull request or open an issue to improve the documentation, add improvements, or report bugs.
+If you simply have a question that needs an answer, create an issue, and label it as a question.
+If you encounter any bugs while using this software, or want to request a new feature or enhancement, feel free to create an issue to report it, make sure you add a label to indicate what type of issue it is.
+Pull requests are welcome for bug fixes.
+If you want to implement something new, please request a feature first so we can discuss it.
+Before you submit any code, we need you to agree to our Contributor License Agreement; this ensures we can continue to protect your contributions under an open source license well into the future.
+Please follow best practices for creating git commits.
+When your code is ready to be submitted, you can submit a pull request to begin the code review process.
+ + + + + + + +The screwdrivercd_install_deps utility is used to define global package build dependencies for multiple packaging
+systems in a single configuration file.
This utility provides a single place to configure global/operating system dependencies +and simplifies creating CI/CD Pipelines that install and build the same package for multiple different +operating system environments in a coherent manner.
+The screwdrivercd_install_deps utility is configured using the pyproject.toml file.
The pyproject.toml file is a toml format configuration file, that is defined as part of Python PEP518 to hold the python package build dependencies.
All of the configuration for the screwdrivercd.installdeps package are under the is under the tool.sdv4_installdeps section which contains the configuration values for the tool as a whole and subsections that define the configuration to use for each package type.
The tool.sdv4_installdeps configuration section defines settings that configure how the utility functions.
Boolean (True/False) value indicating if the installer should immediately fail if a package installation fails.
+The default value is False
+[tool.sdv4_installdeps]
+ fail_on_error = true
+The install configuration setting is an ordered list of the package utilities to run. Optional
+If not provided, a default that will run all the package utilities, ordered to execute the system package utilities, followed by the global python pip3 installed packages.
+[tool.sdv4_installdeps]
+ install = ['apk', 'apt-get', 'brew', 'yum', 'pip3']
+Each package tool has a setting section under the tool.sdv4_installdeps section of the pyproject.toml.
All the package tools have some settings that are common among them, so the same settings have the same format irregardless of the package utility they are defined under.
+The deps setting is a list of package dependencies in a format based on the Python PEP 508 Package dependency specification.
+The specification used by the screwdrivercd.installdeps package adds environment markers which contain
+values from the distro package to allow specifying requirements based on
+attributes of the Operating System distribution.
The environment markers that are supported, are:
+| Marker | +Python equivalent | +Sample values | +
|---|---|---|
| distro_codename | +distro.codename() | +Maipo, bionic | +
| distro_id | +distro.id() | +rhel, ubuntu, darwin | +
| distro_like | +distro.like() | +fedora, debian | +
| distro_name | +distro.name() | +Darwin, Red Hat Enterprise Linux Server, Ubuntu | +
| distro_version | +distro.version() | +7.4, 18.04, 18.6.0 | +
| implementation_name | +sys.implementation.name | +cpython | +
| implementation_version | ++ | 3.4.0, 3.5.0b1 | +
| os_name | +os.name | +posix, java | +
| platform_machine | +platform.machine() | +x86_64 | +
| platform_python_implementation | +platform.python_implementation() | +CPython, Jython | +
| platform_release | +platform.release() | +3.14.1-x86_64-linode39, 14.5.0, 1.8.0_51 | +
| platform_system | +platform.system() | +Linux, Windows, Java | +
| platform_version | +platform.version() | +#1 SMP Fri Apr 25 13:07:35 EDT 2014 Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Oracle Corporation Darwin Kernel Version 14.5.0: Wed Jul 29 02:18:53 PDT 2015; root:xnu-2782.40.9~2/RELEASE_X86_64 | +
| python_version | +'.'.join(platform.python_version_tuple()[:2]) | +3.4, 2.7 | +
| python_full_version | +platform.python_version() | +3.4.0, 3.5.0b1 | +
| sys_platform | +sys.platform | +linux, linux2, darwin, java1.8.0_51 (note that "linux" is from Python3 and "linux2" from Python2) | +
For example, the snippet below will use the yum tool to install the foo_python36 package from the foo python rpm repo
+if the Operating System version is less than 8.0 and install the python3 package if the operating system is version
+8.0 or higher.
[tool.sdv4_installdeps.yum]
+repos.foo = 'https://foo.bar.com/foo_rpms.repo;distro_version<"8.0"'
+deps = [
+ 'foo_python36;distro_version<"8.0"',
+ 'python3;distro_version>="8.0'
+]
+Some package utilities have the concept of package repositories. The repos setting is a dictionary of repository name +and values for repositories to add.
+This setting is only valid for the package utilities that have this concept. The repo setting can be used to define +package repositories to add to the host configuration before installing the package dependencies.
+Like the deps setting, this setting supports using environment markers to specify environments to add the repositories +too.
+For example, this snippet would add the foo yum/rpm repository before installing the packages in Operating system +versions lower than 8.0.
+[tool.sdv4_installdeps.yum]
+repos.foo_rpms = 'https://foo.bar.com/foo_rpms.repo;distro_version<"8.0"'
+The apk utility does not support repositories.
+[tool.sdv4_installdeps.apk]
+ deps = ['python3']
+The apt-get tool supports both the deps and repos settings
+[tool.sdv4_installdeps.apt-get]
+ repos.multiverse = 'multiverse'
+ repos.ppa_deadsnakes = 'ppa:deadsnakes/ppa;distro_version>"17.04"'
+ deps = ['python3']
+The apt-get repos support adding/enabling built in repos, as well as ppa and repository urls.
The brew utility does not currently support repositories.
+[tool.sdv4_installdeps.brew]
+ deps = ['python3']
+The yum tools supports both repos and deps settings.
+[tool.sdv4_installdeps.yum]
+ repos.foo_rpms = 'https://foo.bar.com/foo_rpms.repo'
+ deps = [
+ 'foo_python36;distro_version<"8.0"',
+ 'python3;distro_version>="8.0"'
+ ]
+The yum repos values are executed in order, so it is possible to add a repository url, then enable/disable +specific repositories that where added.
+The yum utility configuration supports enabling/disabling repos in addition to being able to add/remove them.
+A repo configuration value that begins with enable: will enable the repository instead of adding it.
A repo configuraiton value that begins with disable will disable the repository instead of adding it.
repos.foo_rpms = 'https://foo.bar.com/foo_rpms.repo'
+repos.foo_rpms_disable_stable = 'disable:foo_rpms-stable'
+repos.foo_rpms_enable_beta = 'enable:foo_rpms-beta'
+The pip3 tool supports using the python pip3 command to install python packages for global, system wide use. It does not currently support repos.
+[tool.sdv4_installdeps.pip3]
+ deps = ['serviceping']
+Some settings for scrwedrivercd_install_deps command are specified via environment variables.
The following settings are supported:
+| Setting | +Default Value | +Description | +
|---|---|---|
| INSTALLDEPS_DEBUG | +False | +Enable verbose debug output | +
Here is an example that installs the mysql client package and installs the python serviceping package properly on multiple different Linux operating systems.
[tool.sdv4_installdeps]
+ install = ['apk', 'apt-get', 'yum', 'pip3']
+
+ [tool.sdv4_installdeps.apk]
+ deps = ['mysql-client']
+
+ [tool.sdv4_installdeps.apt-get]
+ deps = ['mysql-client']
+
+ [tool.sdv4_installdeps.brew]
+ deps = ['mysql-utilities']
+
+ [tool.sdv4_installdeps.yum]
+ deps = [
+ 'mysql;distro_version<"7.0"',
+ 'mariadb;distro_version>="7.0"'
+ ]
+
+ [tool.sdv4_installdeps.pip3]
+ deps = ['serviceping']
+The screwdrivercd_validate_style command runs the codestyle command from the codestyle package.
All settings for the scrwedrivercd_validate_type command are specified via environment variables.
The following settings are supported:
+| Setting | +Default Value | +Description | +
|---|---|---|
| CODESTYLE_ARGS | ++ | Additional codestyle command arguments | +
| PACKAGE_DIRECTORY | +. | +Directory containing the package source | +
| STYLE_CHECK_DEBUG | +False | +Enable style check debug logging | +
This example runs the codestyle check.
+screwdriver.yaml - With an enforcing type check
+version: 4
+jobs:
+ style_check:
+ template: python/validate_style
+| Directory | +Description | +
|---|---|
| reports/style_validation | +Report files generated by the codestyle command | +
The screwdriver_validate_deps command runs the safety utility to validate the package does
+not use package dependencies with security issues.
This example runs the dependency check
+screwdriver.yaml - With dependency check
+version: 4
+jobs:
+ style_check:
+ template: python/validate_dependencies
+| Directory | +Description | +
|---|---|
| reports/dependency_validation | +Report files generated by the safety command | +
The screwdrivercd_validate_type command runs type annotation validations using the mypy tool.
All settings for the scrwedrivercd_validate_type command are specified via environment variables.
The following settings are supported:
+| Setting | +Default Value | +Description | +
|---|---|---|
| BASE_PYTHON | +python3 | +Python interpreter to use | +
| MYPY_ARGS | +--ignore-missing-imports | +Additional mypy command arguments | +
| PACKAGE_DIRECTORY | +. | +Directory containing the package source | +
| TYPE_CHECK_DEBUG | +False | +Enable debug logging if True | +
| TYPE_CHECK_ENFORCING | +False | +Make check enforcing | +
| TYPE_CHECK_REPORT_FORMAT | +txt,cobertura-xml,junit-xml | +Comma seperated list of report formats to generate. | +
| + | + | Supported formats: | +
| + | + | any-exprs, cobertura-xml, html, junit-xml, | +
| + | + | linecount, linecoverage, memory, txt, xml, | +
| + | + | xslt-html, xslt-txt | +
This example runs the type check with enforcement enabled.
+screwdriver.yaml - With an enforcing type check
+version: 4
+jobs:
+ type_check:
+ template: python/validate_type
+ environment:
+ TYPE_CHECK_ENFORCING: True
+| Directory | +Description | +
|---|---|
| reports/type_validation | +Report files generated by the mypy command | +
The screwdrivercd_validate_unittest command runs unittests via the tox tool.
All settings for the scrwedrivercd_validate_unittest command are specified via environment variables.
The following settings are supported:
+| Setting | +Default Value | +Description | +
|---|---|---|
| BASE_PYTHON | +python3 | +Python interpreter to use | +
| TOX_ARGS | ++ | Additional tox command arguments | +
| TOX_ENVLIST | ++ | Only run tests with specific envlist from the tox configuration | +
This example runs the tox command only using a python 3.8 (py38) virtualenv.
+screwdriver.yaml - With unittest check
+version: 4
+jobs:
+ type_check:
+ template: python/validate_unittest
+ environment:
+ TOX_ARGS: -v
+ TOX_ENVLIST: py38
+| Directory | +Description | +
|---|---|
| logs/tox | +All of the tox log files | +
The versioning helper script is used to update and propagate a version for the package. This helper allows the +version numbers for the package to be defined from the Screwdriver CD Pipeline.
+This allows multiple templates within a CI/CD Pipeline to use the same version number for different operations without +needing to make changes to the source code repository. This makes it possible to have a single pipeline that uses +templates to generate packages and containers in multiple formats that all have the same version without requiring +changes to the source code repository.
+The versioning wrapper command line utility is named screwdrivercd_version.
usage: screwdrivercd_version [-h] [--force_update] [--version_type {default,git_revision_count,utc_date,sdv4_SD_BUILD}] [--ignore_meta] [--update_meta]
+
+optional arguments:
+ -h, --help show this help message and exit
+ --force_update Update the version in setup.cfg even if it does not have a metadata section (default: False)
+ --version_type {default,git_revision_count,utc_date,sdv4_SD_BUILD}
+ Type of version number to generate (default: sdv4_SD_BUILD)
+ --ignore_meta Ignore the screwdriver v4 metadata (default: False)
+ --update_meta Update the screwdriver v4 metadata with a new version (default: False)
+This utility can generate a package version and store it in the screwdriver metadata package.version attribute. The
+--version_type defines the type of package version to generate.
If no arguments are provided, the utility reads it configuration from the [screwdrivercd.version] section of the setup.cfg file.
The utility will update the version of the [metadata] section of the setup.cfg file with the version number from
+the screwdriver pipeline package.version metadata attribute.
Some settings for the scrwedrivercd_version command are specified via environment variables.
The following settings are supported:
+| Setting | +Default Value | +Description | +
|---|---|---|
| VERSION_DEBUG | +False | +Enable debug logging | +
The setup.cfg go under the screwdrivercd.verison setting.
| Setting | +Default Value | +Description | +
|---|---|---|
| version_type | +git_revision_count | +The versioning format to generate, choices: | +
| + | + | git_revision_count - Update the last digit the number of git revisions | +
| + | + | sdv4_sd_build - Update the last digit with the value of the SD_BUILD environment variable | +
| + | + | utc_date - Generate a version based on the date, format: year.monthday.hourminutesecond | +
| + | + | sdv4_date - Generate a version based on the date and SD_BUILD environment variable, format: year.month.SD_BUILD | +
This is an example of the setup.cfg file before and after, with the screwdrivercd_version command run from a
+screwdriver pipeline with a BUILD_ID of 1319.
setup.cfg - Before
+[metadata]
+version=5.0.0
+
+[screwdrivercd.version]
+version_type = sdv4_SD_BUILD
+Output from the screwdrivercd_version command run in the CI Pipeline
+New version: 5.0.1319
+setup.cfg - After
+[metadata]
+version=5.0.1319
+
+[screwdrivercd.version]
+version_type = sdv4_SD_BUILD
+\n {translation(\"search.result.term.missing\")}: {...missing}\n
\n }\n