roderickm / yum-nginx-api

yum-nginx-api is an easy front-end API for yum repositories running on the NGINX web server. It rapidly serves updates to Red Hat and CentOS and supports scaling. It is a deployable solution with Docker or any existing web server with WSGI support. yum-nginx-api enables CI tools to be used for managing and promoting yum repositories.

Home Page:https://github.com/FINRAOS/yum-nginx-api/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yum-nginx-api: A frontend API for yum repositories with NGINX

yum-nginx-api is an easy frontend API for yum repositories running on the NGINX web server. It rapidly serves updates to Red Hat and CentOS and supports scaling.

It is a deployable solution with Docker or any existing web server with WSGI support. yum-nginx-api enables CI tools to be used for managing and promoting yum repositories.

Problems solved with this project:

  1. Serves updates to Red Hat / CentOS really fast and easily scalable.
  2. Limited options for a self-service yum repository to engineers via an API.
  3. Continuous Integration (CI) tools like Jenkins can build, sync, and promote yum repositories with this project unlike Red Hat Satellite Server and Spacewalk.
  4. Poor documentation on installing a yum repository with NGINX web server.

Technologies Needed see install :

  1. Server (Bare-metal/Cloud)
  2. NGINX Web Server
  3. Python Flask (Optional)
  4. Python Gunicorn (Optional)
  5. Python Supervisor (Optional)
  6. Docker (Optional)

Diagram: yum-nginx-api Diagram

Pull Docker image from the Docker Registry

docker pull finraos/yum-nginx-api
docker run -d -p 80:80 finraos/yum-nginx-api

How to build yum-nginx-api (Docker)

git clone https://github.com/FINRAOS/yum-nginx-api.git
cd yum-nginx-api && docker build -t finraos/yum-nginx-api .
docker run -d -p 80:80 finraos/yum-nginx-api
sleep 10 && docker logs `docker ps | grep 'yum-nginx-api' | awk '{ print $1 }' | head -n1` 

How to Install yum-nginx-api (Non-Docker)

# Need EPEL repo installed
git clone https://github.com/FINRAOS/yum-nginx-api.git
yum install -y python-pip supervisor gcc nginx createrepo python-setuptools
cd yum-nginx-api && pip install -r requirements.txt
mkdir -p /opt/repos/pre-release
bash scripts/settings.sh
cp -f supervisor/supervisord.conf /etc/
cp -f supervisor/yumapi.conf /etc/supervisord.d/
cp -rf yumapi /opt/
cp -rf nginx/* /etc/nginx/
supervisord -n -c /etc/supervisord.conf nohup &

API Usage

Post binary RPM to API endpoint:

curl -F file=@yobot-4.6.2.noarch.rpm http://localhost/api/upload

Successful post:

{
  "mime": "application/x-rpm", 
  "name": "yobot-4.6.2.noarch.rpm", 
  "size_mb": 294, 
  "status": 202
}

Unsuccessful post:

{
  "mime": "inode/x-empty", 
  "name": "yobot-4.6.2.noarch.rpm", 
  "size_mb": 0, 
  "status": 415
}

List repo contents package name, arch, version and summary:

curl http://localhost/api/repo

Successful post:

{
  "ami-buildr": {
    "arch": [
     "x86_64",
     "i686"
    ],
    "summary": "AMI Buildr for RHEL 6",
    "version": "2.0"
  },
  "epel-release": {
    "arch": [
     "noarch"
    ],
    "summary": "Extra Packages for Enterprise Linux repository configuration",
    "version": "6"
  }
}

Health check API endpoint

curl http://localhost/api/health

Successful post:

{
  "hostname": "localhost.localdomain",
  "results": [],
  "status": "200",
  "timestamp": 1415729952.407181
}

Contributing & Sponsor

More information on how to contribute to this project including sign off and the DCO agreement, please see the project's GitHub wiki for more information.

FINRA has graciously allocated time for their internal development resources to enhance yum-nginx-api and encourages participation in the open source community. Want to join FINRA? Please visit https://finra.org/careers.

FINRA Logo

License Type

yum-nginx-api project is licensed under Apache License Version 2.0

About

yum-nginx-api is an easy front-end API for yum repositories running on the NGINX web server. It rapidly serves updates to Red Hat and CentOS and supports scaling. It is a deployable solution with Docker or any existing web server with WSGI support. yum-nginx-api enables CI tools to be used for managing and promoting yum repositories.

https://github.com/FINRAOS/yum-nginx-api/wiki

License:Apache License 2.0


Languages

Language:Python 85.0%Language:Shell 15.0%