Skip to main content

LSST the Docs admin client.

Project description

LSST the Docs: Conveyor

Python Package Index Travis CI build status Documentation

Conveyor is a common Python library and command-line app for LSST the Docs (LTD) services and clients.

Key features:

  • ltd command-line app.

    The ltd upload subcommand makes it easy to integrate documentation uploads with continuous integration jobs, particularly Travis CI.

  • The ltdconveyor Python package provides APIs for working with LSST the Docs.

    ltdconveyor.s3 subpackage provides S3 object management services. All documentation hosted by LTD is served through the Fastly CDN, which uses S3 object metadata to purge caches. Conveyor ensures that this metadata is properly set by all clients and microservices that upload, copy, or delete objects from S3.

    ltdconveyor.fastly provides Fastly cache management APIs.

    ltdconveyor.keeper provides APIs for working with LTD Keeper’s REST API.

You can learn more about LTD in our SQR-006 technote.

Read the docs: https://ltd-conveyor.lsst.io

Change log

0.5.0 (2020-02-05)

Added

  • LTD Conveyor can now upload new builds to S3 using Amazon’s S3’s presigned POST URL feature. This means that clients no longer need credentials for S3 — the LTD Keeper API server generates presigned POST URLs as part of the POST /products/<product>/builds/ build registration step.

  • The ltd command now uses the presigned POST-based URLs. The --aws-id and --aws-secret options have been removed, but the --user and --password options remain.

    If you use environment variables, there should be no change in how you use ltd upload (aside from not needing the $LTD_AWS_ID and $LTD_AWS_SECRET environment variables).

Fixed

  • In INFO-level and higher logging, the module path isn’t displayed. Module paths are only shown in DEBUG-level logging where it’s most useful.

Infrastructure

  • Packaging is now done through a setup.cfg file and a pyproject.toml file (PEP 518).

  • Updated Travis CI configuration to test with Python 3.8; also refactored the CI Pipeline with Travis CI stages.

0.4.2 (2018-10-09)

Fixed

  • Fixed a bug where ltdconveyor.s3.delete_dir, since 0.4.1, would raise a TypeError while deleting an empty directory (no objects in the S3 prefix).

0.4.1 (2018-10-08)

Fixed

  • Fixed a bug where ltdconveyor.s3.delete_dir would fail if there are more than 1000 objects under a path prefix that is being deleted.

  • Fixed title of the project in the documentation by updating to use a Documenteer-based Sphinx set up.

0.4.0 (2018-04-17)

Added

  • Added a new command-line app, ltd, that provides subcommands for clients to work with the LSST the Docs API. This app is implemented with Click, and its documentation is automatically generated from the command-line help with sphinx-click.

    The first subcommand is ltd upload, which lets a client upload a site to LTD as a new build. This command includes special features for using the client from Travis CI (ltd upload --travis option) to populate the version information from the Travis environment. Other flags allow ltd upload to become a no-op under certain circumstances (for example, skip uploads on pull requests) or arbitrarily (set ltd upload --skip or export LTD_SKIP_UPLOAD=true).

  • Added the ltdconveyor.keeper subpackage that widens the scope of LTD Conveyor to be a full-service library for building LTD clients, not just an S3 upload client.

    • The ltdconveyor.keeper.login.get_keeper_token function lets you obtain a temporary auth token for the LTD Keeper API.

    • The ltdconveyor.keeper.build module includes functions for performing the build upload handshake with the LTD Keeper API.

Changed

  • Removed Python 2.7 and 3.4 compatibility. Now the codebase is entirely Python 3 (3.5, 3.6)-oriented.

  • Completely reorganized Python namespace. Now all S3 APIs are in ltdconveyor.s3. Fastly APIs are available from ltdconveyor.fastly.

  • Switched to using setuptools_scm to generate version strings for releases.

  • Switched to using extras_require for development dependencies (pip install -e ".[dev]"). This lets us exclusively coordinate dependencies in setup.py.

  • Enable testing via python setup.py test. Also upgrade the testing stack to pytest 3.5 and pytest-flake8 1.0.

  • Compatibility updates to the Sphinx documentation infrastructure.

  • Default to acl=None to support more AWS IAM users. It turns out that not all IAM users with PutObject permissions also have permissions to set the ACL for an object. We want to make it possible for many lightweight IAM users to upload to restricted sub-directories of the lsst-the-docs bucket, but it seems hard to make these users ACL grantees too. We now seek an alternative:

    • The lsst-the-docs bucket now has a PublicRead bucket policy

    • No ACL is set on individual objects.

Fixed

  • Changed assertions to RuntimeErrors. Assertions shouldn’t be used to raise exceptions in production code.

0.3.1 (2017-03-27)

Added

  • Add open_bucket function. This provides a convenient API for getting a boto3 bucket resource, particularly for clients that use the upload_object and upload_file APIs directly that take a bucket only.

0.3.0 (2017-02-20)

Added

  • Added content_type parameter to upload_object so that a user can specify text/html for an HTML upload. The upload_file/upload_dir functions avoid this problem by using Python’s mimetypes library to guess the encoding, but upload_object is lower-level and warrants having the user explicitly provide the content type.

  • Refactored new function create_dir_redirect_object. This code used to be inside upload_dir, but in LTD Dasher it seems necessary to upload files one at a time, and thus it’s necessary to directly create these directory redirect objects.

Fixed

  • Fix issue where '..' shows up in directory names (seen when doing upload_dir with LTD Dasher asset directories).

0.2.0 (2017-02-02)

Added

  • Ported Fastly purge_key function from LTD Keeper. Any LTD application that uploads objects to S3 might also need to purge Fastly CDN caches. This purge capability is presented as a simple function.

0.1.0 (2017-01-25)

Added

  • Port S3 codebase from LTD Mason. The purpose of LTD Conveyor is to provide a set of common S3 APIs that can be used from both client (uploading docs from CI) and server (LTD Keeper) settings.

MIT License

Copyright 2016-2020 Association of Universities for Research in Astronomy, Inc. (AURA)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ltd-conveyor-0.5.0rc2.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

ltd_conveyor-0.5.0rc2-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file ltd-conveyor-0.5.0rc2.tar.gz.

File metadata

  • Download URL: ltd-conveyor-0.5.0rc2.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.1

File hashes

Hashes for ltd-conveyor-0.5.0rc2.tar.gz
Algorithm Hash digest
SHA256 4d1be5813831628fddd401c6c93400e97a4b741d3d9e2f02d874fa140c238319
MD5 442d6461592debc32c39b47a760c9b85
BLAKE2b-256 fa13026e8b87129fdbb6712f2be7a73ff2e9c42f78c1c5736e217eddc1414e20

See more details on using hashes here.

File details

Details for the file ltd_conveyor-0.5.0rc2-py3-none-any.whl.

File metadata

  • Download URL: ltd_conveyor-0.5.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.1

File hashes

Hashes for ltd_conveyor-0.5.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 05dac6582633a62f598e520b74c70b8299f4212c4fb12a9c9aefa79fece6b07a
MD5 84e0b0bf8a3c9b1db124a1843cc9cdff
BLAKE2b-256 2ec192bf80074c4d36a72bd0c5cfac4092f71523f56510f2eb53647c1eb8711b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page