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 details)

Uploaded Source

File details

Details for the file django-oci-0.0.0.tar.gz.

File metadata

  • Download URL: django-oci-0.0.0.tar.gz
  • Upload date:
  • Size: 75.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for django-oci-0.0.0.tar.gz
Algorithm Hash digest
SHA256 2539fa3d345486aca7f10c8fdb2ff686b2d2c05172bcde299738be8605d90c1e
MD5 a1e8f46c9c37cff663e0ae83844cc4f9
BLAKE2b-256 13ddb88b07af0ac1508a544f429ddbc2ef126b573975fd6c16c130788f18f97b

See more details on using hashes here.

Provenance

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