GithubHelp home page GithubHelp logo

thinktainer / yum-nginx-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from finraos/yum-nginx-api

0.0 2.0 0.0 536 KB

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

License: Apache License 2.0

Shell 15.00% Python 85.00%

yum-nginx-api's Introduction

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 [email protected] 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

yum-nginx-api's People

Contributors

marshyski avatar

Watchers

 avatar  avatar

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.