支持多平台运行
项目描述
支持多平台运行
我使用pip-tools,但还想保留我针对多个平台的编译需求。为了避免在机器之间共享目录或其他方式移动文件,我选择了创建romp,它将允许我提交任意工作到Azure Pipelines,以获取对多个平台的访问权限。我个人将主要在boots后面使用它。
以下是示例用法。它将在Linux下运行一个64位CPython 3.6的单个作业。该作业将执行echo red > blue.txt,并将从作业中收集*.txt并保存到本地的artifacts.tar.gz中。
$ venv/bin/romp --platform linux --interpreter cpython --version 3.6 --architecture x86_64 --command 'echo red > blue.txt' --artifact-paths '*.txt' --artifact artifacts.tar.gz
Requesting build
Waiting for build: https://dev.azure.com/altendky/f1722f91-62fe-4a15-8937-252c96b31292/_build/results?buildId=2938
Handling artifact
由于 romp 利用 Azure Pipelines 访问所有平台,因此需要服务器端设置。您需要一个 Azure 账户,并在该账户中创建一个使用 romp 仓库(官方或您自己的分支)的管道(构建)。配置管道以使用 deployed_ci/azure/azure-pipelines-lock.yml。它被配置为不触发构建。 romp 的 CI 和测试由项目根目录中的 azure-pipelines.yml 驱动,但此文件在常规使用中可以忽略。一旦设置好管道,您将需要创建一个 个人访问令牌 (PAT) 以在运行 romp 时进行身份验证。此 PAT 需要启用构建读取和执行范围。
对于本地设置,可以通过环境变量设置命令行选项。对于许多选项,这可能没有意义,但对于少数选项则是有意义的。具体考虑以下选项,这些选项通常在所有调用中都是一致的。
- ROMP_BUILD_REQUEST_URL
'https://dev.azure.com/altendky/romp-on/_apis/build/builds?api-version=5.0'
- ROMP_DEFINITION_ID
5
- ROMP_PERSONAL_ACCESS_TOKEN
fp6al3jxta2zliz6rh5hr6ewd5nw2hsmasse2laiyoyg7otneqjq
- ROMP_USERNAME
altendky
$ venv/bin/romp --help
Usage: romp [OPTIONS]
Options:
--personal-access-token, --pat TEXT
A personal access token (PAT) with rights to
initiate builds
($ROMP_PERSONAL_ACCESS_TOKEN)
--build-request-url TEXT The URL for submitting a build request
($ROMP_BUILD_REQUEST_URL) [default: https:/
/dev.azure.com/altendky/romp/_apis/build/bui
lds?api-version=5.0]
--command TEXT The command to be run for each target
($ROMP_COMMAND) [default: python -c 'import
sys; print(sys.version);
print(sys.platform)']
--username TEXT Username for build URL authentication
($ROMP_USERNAME) [default: altendky]
--environments TEXT Targets to run on. Mostly use the matrix
options instead. This may be removed.
($ROMP_ENVIRONMENTS)
--check-period INTEGER The period used to poll the build for
completion ($ROMP_CHECK_PERIOD) [default:
15]
--source-branch TEXT The romp source branch to use for the build
($ROMP_SOURCE_BRANCH) [default: develop]
--definition-id INTEGER The definition id of the build to be
triggered ($ROMP_DEFINITION_ID) [default:
3]
--archive-file FILENAME The archive to be uploaded to the build
($ROMP_ARCHIVE)
--artifact FILENAME The path at which to save the resulting
artifact ($ROMP_ARTIFACT_PATH)
--artifact-paths TEXT Paths on remote system to build the artifact
archive from. Wildcards are supported via
bash. ($ROMP_ARTIFACT_PATHS)
--platform [Linux|macOS|Windows]
Platforms to matrix across
($ROMP_MATRIX_PLATFORMS) [default: Linux,
macOS, Windows]
--interpreter [CPython|PyPy] Interpreters to matrix across
($ROMP_MATRIX_INTERPRETERS) [default:
CPython, PyPy]
--version [2.7|3.4|3.5|3.6|3.7]
Versions to matrix across
($ROMP_MATRIX_VERSIONS) [default: 2.7, 3.4,
3.5, 3.6, 3.7]
--architecture [x86|x86_64] Architectures to matrix across
($ROMP_MATRIX_ARCHITECTURES) [default: x86,
x86_64]
--include <PLATFORM INTERPRETER VERSION ARCHITECTURE>
Complete environments to include in the
matrix ($ROMP_MATRIX_INCLUDES)
--exclude <PLATFORM INTERPRETER VERSION ARCHITECTURE>
Complete environments to exclude from the
matrix ($ROMP_MATRIX_EXCLUDES)
--archive-paths-root DIRECTORY Files in the uploaded archive will be stored
with paths relative to this path.
($ROMP_ARCHIVE_PATHS_ROOT)
--archive-path TEXT Files to include in the archive which will
be extracted prior on the remote system
prior to running the remote command.
($ROMP_ARCHIVE_PATHS)
--verbose Increase logging verbosity by up to 2 levels
($ROMP_VERBOSITY)
--help Show this message and exit.
项目详情
下载文件
下载您平台上的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。