Giter Club home page Giter Club logo

rblcoder / multi-region-python-package-publishing-pipeline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/multi-region-python-package-publishing-pipeline

0.0 0.0 0.0 1.3 MB

This git repository is designed to demonstrate how to build and publish pip packages to CodeArtifact Repositories in Multiple Regions by using CodePipeline and the AWS CDK.

License: MIT No Attribution

JavaScript 10.97% Python 5.64% TypeScript 83.39%

multi-region-python-package-publishing-pipeline's Introduction

Multi Region Package Publishing Pipeline

This git repository is designed to demonstrate how to build and publish pip packages to CodeArtifact Repositories in Multiple Regions by using CodePipeline and the AWS CDK.

Architecture

alt text

Prerequisites

Deployment instructions:

Install the CDK Application code

  • Fork the aws-samples/multi-region-python-package-publishing-pipeline repository
  • git clone [email protected]:<YOUR_GITHUB_USERNAME>/multi-region-python-package-publishing-pipeline.git
  • cd multi-region-python-package-publishing-pipeline
  • npm i
  • (Optional) Override default configurations for the CodeArtifact domainName, repositoryName, primaryRegion, and replicaRegion
    • navigate to ./bin/multiregion_package_publishing.ts and update relevant fields

Deploy the CDK Application

  • cdk deploy --all from the app root directory multi-region-python-package-publishing-pipeline/
    • Enter y for all prompts

Investigate what you've built

Look at the CodePipeline that has three stages (Source, Build, and Publish) and the monitor the CodeBuild Projects in the Build/Publish phases while you wait for the pipeline to complete. After ~7 minutes, the pipeline should have a status of success

Navigate to the CodeCommit Repository which has the Source Code for your Custom pip Package. Follow the instructions in the CodeCommit PackageSourceCode Repository's README (source code originates from this directory) to add a commit to the main branch and trigger the pipeline to run again

Test an install of the package

  • Configure your local pip to use the CodeArtifact Primary (or Replica) Repository aws codeartifact login --tool pip --repository package-artifact-repo --domain custom-package-domain --domain-owner <ACCOUNTID>
  • Download the package: pip3 install mypippackage==1.0.0
  • Start the Python REPL python3
>>> import customPackage1
>>> from customPackage1 import module1, module2
>>> from customPackage1.module2 import function2

>>> customPackage1.module1.function1()
This is function1

>>> module1.function1()
This is function1

>>> module2.function2()
This is function2

Time to call function1...
This is function1

>>> function2()
This is function2

Time to call function1...
This is function1

Clean Up

  • Destroy cloud resources by running cdk destroy --all from the root app directory multi-region-python-package-publishing-pipeline/
  • Reconfigure pip to look at the standard pypi repository pip3 config set global.index-url https://pypi.org/simple

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

multi-region-python-package-publishing-pipeline's People

Contributors

bsmitches avatar amazon-auto avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.