Skip to main content

Open Containers distribution API for Django

Project description

django-oci

https://badge.fury.io/py/django-oci.svg https://travis-ci.org/vsoch/django-oci.svg?branch=master https://codecov.io/gh/vsoch/django-oci/branch/master/graph/badge.svg

Open Containers distribution API for Django.

under development

Not all files are added yet to this repository, so it will not work! This readme will be updated when all is ready.

This repository will serve a Django app that can be used to provide an opencontainers distribution (OCI) endpoint to push and pull containers. An example application is provided in tests that can be interacted with here.

Quickstart

Install django-oci::

pip install django-oci

Add it to your INSTALLED_APPS along with rest_framework

    INSTALLED_APPS = (
        ...
        'django_oci',
        'rest_framework',
        'chunked_upload',
        ...
    )

Add django-oci's URL patterns:

    from django_oci import urls as django_oci_urls
    urlpatterns = [
        ...
        url(r'^', include(django_oci.urls)),
        ...
    ]

Example Application

You can develop or test interactively using the example (very simple) application under tests. First create a virtual environment with the dependencies that you need:

python -m venv env
source env/bin/activate
pip install -r requirements.txt

For development you can install the django_oci module locally:

$ pip install -e .

The manage.py is located in the root directory so it's easy to update your install ad then interact with your test interface.

python manage.py makemigrations django_oci
python manage.py migrate django_oci
python manage.py runserver

Authentication

todo

Push a Container

When your server is running with python manage.py runserver then you can try pushing a container with the provided script push-container.py

# Obtain a container
singularity pull docker://busybox

# Push it
python push-container.py busybox_latest.sif vanessa/test:latest

The push script uses a Multipart upload to interact with the API.

Testing

Tests are located in tests and can be run with:

python runtests.py

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox


## Many Thanks 


* [cookiecutter-djangopackage](https://github.com/pydanny/cookiecutter-djangopackage)

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

django-oci-0.0.0.tar.gz (75.0 kB view hashes)

Uploaded Source

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