Minimal Yum Repo Server, with ReST API and deduplicating Filesystem Backend
- simple ReST API: create/remove repos, upload/move/remove rpms
- fast read access: uses nginx as frontend
- dedicated update command: you decide when to recalculate repo metadata
- fast metadata calculation: uses C implementation, merges pre-calculated metadata
- deduplicated RPMs: hardlinked copies only
- supports symbolic repo links
- there is a dedicated HiRes Promo Website
follow instructions in the centos7-specific repository
git clone https://github.com/arnehilmann/yumrepos.git
cd yumrepos
scripts/init-virtualenv
. venv/bin/activate
# start a basic development server
./src/main/scripts/yumrepos
# now use the API with $HOST=http://127.0.0.1:8080/
then see the full lifecycle test
curl $HOST/repos/
response: 200 OK, exit code of curl != 0
curl -X PUT $HOST/admin/v1/repos/NEW_REPO
response: 201 CREATED, 403 FORBIDDEN (wrong reponame, non-existing path)
curl -F pathspec="PATHSPEC" $HOST/admin/v1/repos
PATHSPEC: define pathes via brace expansion
pathspec example:
curl -F pathspec="base/{6,7}/{x86_64,noarch}" $HOST/admin/v1/repos
results in the following repo hierarchy:
base/
+-- 6/
| +-- x86_64/
| +-- noarch/
|
+-- 7/
+-- x86_64/
+-- noarch/
response: 201 CREATED, 403 FORBIDDEN (wrong reponame, non-existing path), 400 BAD REQUEST (missing/malformed pathspec)
curl $HOST/$TESTREPO1/
response: 200 OK, 404 NOT FOUND
curl -F rpm=@file_to_be_uploaded.rpm $HOST/admin/v1/repos/TARGET_REPO
response: 201 CREATED, 404 NOT FOUND
curL $HOST/admin/v1/repos/TARGET_REPO/RPM?info
response: 200 OK (info in response body as json), 404 NOT FOUND
curl -X STAGE $HOST/admin/v1/repos/SOURCE_REPO/RPM?stageto=TARGET_REPO
response: 201 CREATED, 404 NOT FOUND (source rpm not found), 409 CONFLICT (rpm already present in target repo)
curl -X COPY $HOST/admin/v1/repos/SOURCE_REPO/RPM?copyto=TARGET_REPO
response: 201 CREATED, 404 NOT FOUND (source rpm not found), 409 CONFLICT (rpm already present in target repo)
curl -X DELETE $HOST/admin/v1/repos/OBSOLETE_REPO
repsonse: 204 NO CONTENT, 409 CONFLICT (if not empty)
curl -X PUT $HOST/admin/v1/repos/NEW_REPO?link_to=REPO_ALREADY_PRESENT
response: 201 CREATED, 404 NOT FOUND (repo not already present)
curl $HOST/admin/v1/repos/REPO_TO_CHECK?is_link
repsonse: 200 OK (true or false in response body), 404 NOT FOUND
curl -X DELETE $HOST/admin/v1/repos/REPO/RPM_TO_DELETE
response: 204 NO CONTENT, 404 NOT FOUND
curl -X DELETERECURSIVLY $HOST/admin/v1/repos/REPO_TO_BE_DELETED
response: 204 NO CONTENT, 404 NOT FOUND
curl -X POST $HOST/admin/v1/shutdown
response: 200 OK, 403 FORBIDDEN (when not in standalone mode)
docker run -it -v $PWD:/local -w /local centos:7 bash
yum install -y createrepo_c
scripts/init-virtualenv
. ve/bin/activate
# do stuff
pyb
docker run -it -v $PWD:/local -w /local alanfranz/fwd-centos-7 fpm -s empty -t rpm -n foo -v 1.42
git clone https://github.com/rpm-software-management/createrepo_c.git
cd createrepo_c
docker run -v $PWD:/local -it ubuntu:trusty bash
mkdir build
cd build
apt-get update
apt-get install -y libbz2-dev cmake libexpat1-dev libmagic-dev libglib2.0-dev libcurl4-openssl-dev \
libxml2-dev libpython2.7-dev librpm-dev libssl-dev libsqlite3-dev liblzma-dev zlib1g-dev doxygen \
check python-nose
cmake ..
make
mkdir -p docroot/usr/{bin,lib}
mv src/lib* docroot/usr/lib
mv src/*_c docroot/usr/bin
exit
fpm -t deb -n createrepo_c -s dir -C docroot/ --verbose .