Giter Club home page Giter Club logo

umpire's Introduction

Umpire: A Dependency Manager

Umpire is a Python-based generic dependency resolver which aims to be platform agnostic, extensible, and simple to use.

Umpire was developed as an easy to install command line tool, with it's flexibility being derived from the JSON file options.

Umpire reads a JSON file to retrieve, cache, and link files to their appropriate destination from an Amazon S3 backed repository of compressed packages.

Installation

Umpire requires Python 3.11.6 or above

Umpire is available as a pip package.

To install Umpire:

  1. Download get-pip.py from PyPA.
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  1. Run the Python script to complete the install.
$ python get-pip.py
  1. Use latest python3 pip to install Umpire.
$ pip3 install umpire

Development

To run a local version of the Umpire

you clone the repo. and then do a

pip3 install -e <path to the repo> 

now the umpire will be from your local development repo

You can check by running

pip3 freeze | grep umpire

Examples

Below is an example deployment JSON file. The URL is composed of the identifier (s3://) and the bucket name. When using an authenticated bucket, the user must have either the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables set or a properly configured credentials file for your platform.

The items array contains the list of dependencies. Each one requires a platform, name and version. In the s3 bucket they need to be stored with the prefix: $PLATFORM/$NAME/$VERSION. Umpire does a case insensitive match against this naming convention to find the appropriate dependency. It will download all files matching the prefix in the bucket, and will attempt to unpack them for future deployment.

There's also a couple of other options that you can specify. They are:

link: [true/false] -- Specifies whether Umpire should link the dependency files to the destination or copy them. Default true.

keep_updated: [true/false] -- Specifies whether Umpire should check with the remote S3 bucket when run to see if the dependency has been changed. Default false.

[
     {
         "url":"s3://umpire-test/",
         "items":[
             {
                 "name":"test",
                 "version":"test_tgz",
                 "platform":"test",
                 "keep_updated":true,
                 "link":false,
                 "destination":"$ENVIRONMENT_VARIABLE/destination"
             },
             {
                 "name":"test",
                 "version":"test_zip",
                 "platform":"test",
                 "keep_updated":true,
                 "destination":"./destination"
             }
         ]
     }
 ]

Contributing

Want to help out? Awesome!

We'll gladly take any help in bug fixes, or feature updates if it fits within our whole vision of Umpire. Feel free to create a fork of the repository, and submit a pull request if you do anything cool.

Todos

  • Publishing support
  • Bzip support
  • Optional unpacking
  • File exclusion

License


Umpire is licensed under the MIT license

umpire's People

Contributors

wjia7 avatar miketypeguy avatar mbuttler avatar shanebarnes avatar dnorth98 avatar haggaret avatar

Stargazers

Jiim Knopf avatar  avatar Nikolay Kolev avatar Justin Iravani avatar Matthew Corner avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Ryan McIntyre avatar Fahim avatar Matthew Corner avatar  avatar

Forkers

pombredanne

umpire's Issues

Possible lock files left when Umpire exits abnormally

If Umpire is killed, or otherwise exits abnormally, it is possible that it will leave lock files in the cache (default filename: .umplock). These lock files stop multiple umpire processes from modifying the cache at the same time, and are essential to Umpire working properly in certain situations.

Workaround:

Umpire has a default timeout of 10 minutes in which it will wait before forcing the lock. Additionally, it will print out an INFO message stating that it has found a lockfile. If you're certain nothing is using the cache, you can execute the command:

'umpire -r'

Which will clear the lock files from the cache.

Blank Errors Shown

Some errors are shown as:

ERROR --

Expecting an error message. This is because of the way error messages are passed up through subprocesses. There's a bug with the underlying framework where it will lose the error if it's passed up through two or more subprocesses to the parent Umpire process.

Workaround:

None, currently.

Windows: Unable to clear or repair cache -- Permission Denied

On Windows you can occasionally get a Permission Denied (OSError) error when running:

umpire --clear-cache
or
umpire --repair-cache

This has to do with Windows permissions, and the root cause is currently undetermined.

Work around:

Delete the umpire cache directly, which by default is under the running user's folder: (ex: C:\Users$USERNAME.umpire)

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.