This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Evan Cordell c1cbc73779 Update CHANGELOG.md 2016-12-09 16:14:47 -05:00
auth registry auth tests: test more access types 2016-11-28 14:02:08 -05:00
avatars Add support for linking to external users in entity search 2016-10-27 15:42:03 -04:00
buildman Merge pull request #2203 from charltonaustin/fix_build_component_cleanup 2016-12-06 14:13:10 -05:00
buildstatus Adding in UI for cancel anytime. 2016-11-21 10:58:32 -05:00
buildtrigger Make sure we never have a None default branch 2016-11-17 14:22:01 -05:00
conf Merge pull request #2180 from coreos-inc/requests-ssl 2016-12-05 13:03:54 -05:00
data Removing an unused import. 2016-12-08 13:53:52 -05:00
digest Merge branch 'newchanges' into python-registry-v2 2015-11-06 18:24:32 -05:00
emails emails: add missing periods to sentences in emails 2016-08-09 15:36:47 -07:00
endpoints Remove unneeded exception var 2016-12-09 14:52:49 -05:00
events Less verbose notifications for QSS 2016-10-10 15:18:49 -04:00
features Strip whitespace from ALL the things. 2014-11-24 16:07:38 -05:00
grunt Disable source map generation 2015-11-30 11:42:45 -05:00
health Add a configuration flag for external TLS termination 2016-09-22 18:28:57 -04:00
image Fix parent rewrite bug in schema1 manifest code and add a bunch more tests 2016-10-04 09:15:27 -04:00
static Have Quay always use an OAuth-specific CSRF token 2016-12-08 16:11:57 -05:00
storage Add support for custom ports on RADOS and S3 storage engines 2016-12-01 14:23:18 -05:00
templates Have all error pages be rendered by Angular 2016-12-07 17:49:02 -05:00
test Switch csrf token check to use `compare_digest` to prevent timing attacks 2016-12-08 23:46:31 -05:00
tools Properly handle refunds in their appropriate month. Handle discounts. 2016-09-15 10:23:35 -04:00
util Fix loading of public keys for OIDC under Linux 2016-12-09 14:26:56 -05:00
workers Fixing api usage. 2016-12-07 12:53:07 -05:00
.dockerignore Add pytest and tox to run tests 2016-11-28 13:13:07 +01:00
.gitignore Add pytest and tox to run tests 2016-11-28 13:13:07 +01:00
CHANGELOG.md Update CHANGELOG.md 2016-12-09 16:14:47 -05:00
Dockerfile Bust apt cache 2016-12-07 18:09:33 -05:00
MAINTAINERS MAINTAINERS: initial commit 2015-08-04 21:39:33 -07:00
Procfile Run gunicorn and webpack through Procfile 2016-10-20 13:50:57 -04:00
README.md Add pytest and tox to run tests 2016-11-28 13:13:07 +01:00
ROADMAP.md Update the roadmap for current sprint and strip from QE 2016-03-04 11:29:51 -05:00
alembic.ini Print the time when logging from migrations 2015-11-09 22:29:17 -05:00
app.py Add GC of layers in Clair 2016-12-06 19:52:56 -05:00
application.py Split secscan endpoints into a new process 2016-05-02 11:38:00 -04:00
boot.py Use the instance service key for registry JWT signing 2016-06-07 11:58:10 -04:00
build.sh Update build.sh to work with GIT_HEAD 2015-11-04 16:55:34 -05:00
config.py Merge pull request #2204 from jzelinskie/429builds 2016-12-07 15:03:31 -05:00
dev.df Refactor prometheus integration 2016-07-01 14:16:50 -04:00
external_libraries.py frontend: fix gitlab icon spacing 2016-09-28 14:06:10 -07:00
initdb.py Merge pull request #2182 from coreos-inc/fix-full-db-tests 2016-12-01 14:33:22 -05:00
local-docker.sh local-docker.sh now accepts env vars 2016-07-08 15:50:51 -04:00
local-run.sh Run gunicorn and webpack through Procfile 2016-10-20 13:50:57 -04:00
local-test.sh use kwargs for parse_repository_name 2016-03-09 16:20:28 -05:00
package.json Repo-view page with header, sidebar and body 2016-11-28 16:41:46 -05:00
pylintrc database: initial manifestlist schema changes 2016-09-26 14:47:06 -04:00
registry.py Merge remote-tracking branch 'upstream/v2-phase4' into python-registry-v2 2015-10-22 16:59:28 -04:00
release.py superuser: add storage replication config 2015-11-09 17:34:22 -05:00
requirements-dev.txt reqs: add ipdb to dev 2016-05-27 14:44:30 -04:00
requirements-nover.txt requirments.txt: lock breaking dependencies 2016-10-18 15:41:26 -04:00
requirements-tests.txt Add pytest and tox to run tests 2016-11-28 13:13:07 +01:00
requirements.txt requirments.txt: lock breaking dependencies 2016-10-18 15:41:26 -04:00
secscan.py Split secscan endpoints into a new process 2016-05-02 11:38:00 -04:00
setup.cfg Add pytest and tox to run tests 2016-11-28 13:13:07 +01:00
tox.ini Add pytest and tox to run tests 2016-11-28 13:13:07 +01:00
tsconfig.json Add relative path mapping 2016-11-07 17:31:11 -05:00
tslint.json Namespace page directories 2016-10-31 16:35:11 -04:00
typings.json Setup skeleton files for new front end build tool (Node, Webpack, React, Typescript) 2016-10-18 17:13:56 -04:00
verbs.py Add DEBUGLOG flag for enabling full debug logs in all gunicorn components 2015-10-13 10:45:49 -04:00
web.py create key server data interface 2016-09-26 14:49:23 -04:00
webpack.config.js Add relative path mapping 2016-11-07 17:31:11 -05:00

README.md

quay

Docker Repository on Quay

Note: The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in order to get stable binaries.

Quay Logo

Quay is project to build, store, and distribute container images.

High-level features include:

Getting Started

macOS

macOS developers will need:

# Download the code
git clone git@github.com:coreos-inc/quay.git && cd quay

# Install the system dependencies
brew install libevent libmagic postgresql gpgme pyenv pyenv-virtualenv docker docker-machine node

# create a default virtualmachine for docker
docker-machine create -d virtualbox default

# setup brew dependencies
# note you may want to add these to your bashrc or zshrc file
eval "$(pyenv virtualenv-init -)"
eval "$(pyenv init -)"
eval $(/usr/local/bin/docker-machine env default)

# Some installs don't have /usr/include, required for finding SASL header files
# http://apple.stackexchange.com/questions/196224/unix-ln-s-command-not-permitted-in-osx-el-capitan-beta3
# note this command might fail because of new OSx write protections here above is a link that explains
# how to fix that
if [ ! -e /usr/include ]; then sudo ln -s `xcrun --show-sdk-path`/usr/include /usr/include; fi

# Install the Python dependencies
pyenv install 2.7.11
pyenv virtualenv 2.7.11 quay
pyenv activate quay

# Some packages may fail to build with clang (which now defaults to C11).
CFLAGS='-std=c99' pip install -r requirements.txt
pip install -r requirements-dev.txt

# Setup a local config
git clone git@github.com:coreos-inc/quay-config.git ../quay-config
ln -s ../../quay-config/local conf/stack

# Install Node Dependencies
npm install

# Link Typescript
npm link typescript

Useful docs

docker docker-machine pyenv pyenv-virtualenv

Linux

TODO

Running and Testing

Test Data

A SQLite database full of test data is committed to this git repository at test/data/test.db. This database is generated by executing python initdb.py. The username and password of the admin test account is devtable and password, respectively.

Local Scripts

Running the web server locally requires goreman:

go get github.com/mattn/goreman
  • local-run runs the web server for testing
  • local-test runs the unit test suite
  • npm run build builds front end dependencies
  • npm run watch a watcher for webpack

Development inside Docker

To build and run a development container, pass one argument to local-docker.sh:

  • buildman: run the buildmanager
  • dev: run web server on port 5000
  • initdb: clear and initialize the test database
  • notifications: run the notification worker
  • test: run the unit test suite

Adding a Python Dependency

# Create a new virtualenv and activate it
pyenv virtualenv 2.7.11 quay-deps
pyenv activate quay-deps

# Install unversioned dependencies with your changes
pip install -r requirements-nover.txt

# Run the unit test suite
./local-test.sh

# Freeze the versions of all of the dependencies
pip freeze > requirements.txt

Running the Build System

TODO

# Run an instance of redis
docker run -d -p 6379:6379 quay.io/quay/redis

To run individual tests

# To run a specific suite
TEST=true python -m test.test_api_usage -f

# To run a specific test in a suite
TEST=true python -m test.test_api_usage -f SuiteName

Pytest

# To run all tests
TEST=true PYTHONPATH="." py.test --verbose test/

# To run a specific test module
TEST=true PYTHONPATH="." py.test --verbose test/registry_tests.py

# To run a specific test unique test
TEST=true PYTHONPATH="." py.test --verbose test/test_api_usage.py::TestDeleteNamespace

# To retry only last failed (--lf):
TEST=true PYTHONPATH="." py.test --verbose --lf

# To start pdb on failure:
TEST=true PYTHONPATH="." py.test --verbose --pdb

# To run a coverage report (html pages in ./htmlcov):
TEST=true PYTHONPATH="." py.test --cov="." --cov-report=html --cov-report=term-missing  --cov-config=.coverage.ini --verbose

# Don't capture stdout (-s)
TEST=true PYTHONPATH="." py.test --verbose -s

Tox

To create a virtualenv to run the tests. It allows to test the code on multiple env like python2.x and python3.x or different library versions

# Test all tox env:
tox

# Add extra parameters to the pytest command:
# tox -- [pytest ARGS]
tox -- -x

# build a single env with -e:
tox -e py27-api

Running migrations

# To create a new migration with this description.
# Note there might be some errors about unique id being to long
# That's okay as long as the migration file is created
./data/migrations/migration.sh "Description goes here"

# To test the up and down of the migration
./data/migrations/migration.sh # without params

# Migrations get run when you create a docker image or you can run them
# manually with the following command.
PYTHONPATH=. alembic upgrade head

# You can also rebuild your local sqlite db image from initdb.py using
# And once you have a migration you should do this and check in the
# changes to share your migration with others.
rm test/data/test.db
python initdb.py

How to run a build with tests for a push or merge

# Inside the quay directory.
export QUAY_TAG=quay.io/quay/quay:localtest
docker build -t $QUAY_TAG --build-arg RUN_TESTS=true .

Documentation

Architecture at a Glance

Terminology

Organizations

  • AppC: a standards body responsible for a Runtime and Image Format superseded by the Open Container Initiative
  • Open Container Initiative: a standards body responsible for a Runtime specification and an Image Format
  • Docker: a company that builds a platform that has its own Image Formats, Build System, Container Runtime, and Container Orchestration

Concepts

  • Image: an archive containing all of the contents necessary to execute a container
  • Image Format: a specification for the structure of an Image
  • Image Layer: an Image that may depend on being applied to other Images to generate a final Image
  • Image Squashing: the process of compressing an Image into a single Layer
  • Manifest: a text file containing metadata for a particular Image
  • Tag: a human-friendly named, mutable pointer to a particular set of Images
  • Build System: a program used to generate Images
  • Registry: a program that speaks one or more standard protocols to store and receive Images
  • Repository: a collection of related Tags organized by a Registry
  • Push: the act of uploading an Image to a Registry
  • Pull: the act of downloading an Image from a Registry
  • Container: an Image and its execution environment
  • Container Runtime: a program that can transform an Image into a Container by executing it
  • Container Orchestration: a program or set of programs that provides a framework for deploying Containers

Software

  • Quay.io: CoreOS's hosted Registry
  • Quay: CoreOS's enterprise-grade Registry product
  • quayctl: an open source program that implements alternative methods for pulling Images from Quay
  • Clair: an open source static analysis tool used to detect vulnerability in Images
  • Quay Security Scanning: the integration between Clair and Quay
  • Kubernetes: an open source program implementing Container Orchestration
  • Docker Hub: Docker's hosted Registry
  • Docker Trusted Registry: Docker's enterprise-grade Registry product
  • Notary: an open source implementation of the TUF protocol used in Docker Content Trust
  • Docker Content Trust: the integration between Notary and Docker Trusted Registry
  • Docker Engine: a program used to interact with all aspects of the Docker platform
  • Swarm: a program implementing Container Orchestration for the Docker platform