Skip to content

Commit

Permalink
Merge pull request #45 from ARGOeu/devel
Browse files Browse the repository at this point in the history
Version 0.2.0-1
  • Loading branch information
themiszamani authored Jun 8, 2017
2 parents 786560b + 5f361ff commit 30ec7b3
Show file tree
Hide file tree
Showing 28 changed files with 3,030 additions and 90 deletions.
89 changes: 0 additions & 89 deletions .gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: python
# Target py version 2.6
python:
- "2.6"

install:
- "pip install requests"
- "pip install httmock"

script: nosetests
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include pymod/*
include helpers/*
include examples/*
include README.md
include argo-ams-library.spec

recursive-exclude pymod *.pyc *.pyo
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PKGNAME=argo-ams-library
SPECFILE=${PKGNAME}.spec

PKGVERSION=$(shell grep -s '^Version:' $(SPECFILE) | sed -e 's/Version: *//')

srpm: dist
rpmbuild -ts --define='dist .el6' ${PKGNAME}-${PKGVERSION}.tar.gz

rpm: dist
rpmbuild -ta ${PKGNAME}-${PKGVERSION}.tar.gz

dist:
rm -rf dist
python setup.py sdist
mv -f dist/${PKGNAME}-${PKGVERSION}.tar.gz .
rm -rf dist

sources: dist

clean:
rm -rf ${PKGNAME}-${PKGVERSION}.tar.gz
rm -f MANIFEST
rm -rf dist
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,65 @@
# argo-ams-library
A simple library for interacting with the ARGO Messaging Service

<img src="https://jenkins.argo.grnet.gr/static/3c75a153/images/headshot.png" alt="Jenkins" width="25"/> [![Build Status](https://jenkins.argo.grnet.gr/job/argo-ams-library_devel/badge/icon)](https://jenkins.argo.grnet.gr/job/argo-ams-library_devel)

A simple python library for interacting with the ARGO Messaging Service.

The Messaging Services is implemented as a Publish/Subscribe Service. Instead of focusing on a single Messaging API specification for handling the logic of publishing/subscribing to the broker network the API focuses on creating nodes of Publishers and Subscribers as a Service.

In the Publish/Subscribe paradigm, Publishers are users/systems that can send messages to named-channels called Topics. Subscribers are users/systems that create Subscriptions to specific topics and receive messages.

You may find more information about [the ARGO Messaging Service documentation](http://argoeu.github.io/messaging/v1/)

## Library installation

You may find and download the ARGO Messaging Library from ARGO Repository.

If you want the devel instance so as to test all new features

http://rpm-repo.argo.grnet.gr/ARGO/devel/centos6/argo-ams-library-*.*.*

```
The current first realese is
http://rpm-repo.argo.grnet.gr/ARGO/devel/centos6/argo-ams-library-0.1.0-20170301161111.55fe753.el6.noarch.rpm
```

If you want the stable instance you may download it from here
http://rpm-repo.argo.grnet.gr/ARGO/prod/centos6/


## Examples

In the folder examples, you may find examples of using the library:

- for publishing messages (examples/publish.py)
- for consuming messages in pull mode (examples/consume-pull.py)

### Publish messages

This example explains how to publish messages in a topic with the use of the library. Topics are resources that can hold messages. Publishers (users/systems) can create topics on demand and name them (Usually with names that make sense and express the class of messages delivered in the topic). A topic name must be scoped to a project.

You may find more information about [Topics in the ARGO Messaging Service documentation](http://argoeu.github.io/messaging/v1/api_topics/)

```
publish.py --host=[the FQDN of AMS Service]
--token=[the user token]
--project=[the name of your project registered in AMS Service]
--topic=[the topic to publish your messages]
```


### Consume messages in pull mode

This example explains how to consume messages from a predefined subscription with the use of the library. A subscription is a named resource representing the stream of messages from a single, specific topic, to be delivered to the subscribing application. A subscription name must be scoped to a project. In pull delivery, your subscriber application initiates requests to the Pub/Sub server to retrieve messages. When you create a subscription, the system establishes a sync point. That is, your subscriber is guaranteed to receive any message published after this point. Messages published before the sync point may not be delivered.

You may find more information about [Subscriptions in the ARGO Messaging Service documentation](http://argoeu.github.io/messaging/v1/api_subs/)

```
consume-pull.py --host=[the FQDN of AMS Service]
--token=[the user token]
--project=[the name of your project registered in AMS Service]
--topic=[the topic from where the messages are delivered ]
--subscription=[the subscription name to pull the messages]
--nummsgs=[the num of messages to consume]
```
53 changes: 53 additions & 0 deletions argo-ams-library.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

%define underscore() %(echo %1 | sed 's/-/_/g')

Name: argo-ams-library
Version: 0.2.0
Release: 1%{?dist}
Summary: A simple python library for interacting with the ARGO Messaging Service

Group: Development/Libraries
License: ASL 2.0
URL: https://github.com/ARGOeu/argo-ams-library
Source0: %{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python2-devel
Requires: python-requests

%description
A simple python library for interacting with the ARGO Messaging Service

%prep
%setup -q

%build
%{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT --record=INSTALLED_FILES

%files -f INSTALLED_FILES
%doc examples/ README.md
%defattr(-,root,root,-)
%dir %{python_sitelib}/%{underscore %{name}}
%{python_sitelib}/%{underscore %{name}}/*.py[co]

%changelog
* Mon Jun 5 2017 Daniel Vrcic <[email protected]> - 0.2.0-1%{?dist}
- ARGO-782 Iterate over subscriptions and topics methods
- ARGO-789 Topic and subscription creation/deletion that mimic Google implementation
- ARGO-791 Methods for settings acls on topics and subscriptions
- ARGO-804 Has topic/sub methods should have ability to pass kwargs to python-requests library
- ARGO-812 Mimicked topic and subcription methods will always return corresponding objects
- ARGO-814 Publish method accepts directly list of AmsMessage objects
* Fri Mar 17 2017 Daniel Vrcic <[email protected]>, Themis Zamani <[email protected]>, Konstantinos Kagkelidis <[email protected]> - 0.1.1-1%{?dist}
- ARGO-760 Has topic and subscription methods
- ARGO-770 AMS Library tests
* Thu Mar 2 2017 Daniel Vrcic <[email protected]> - 0.1.0-2%{?dist}
- ARGO-710 Provide examples of simple publishing and consuming
* Fri Feb 24 2017 Daniel Vrcic <[email protected]> - 0.1.0-1%{?dist}
- first version
19 changes: 19 additions & 0 deletions documentation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# vim:set ft=dockerfile:
FROM debian:jessie

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
python \
python-setuptools \
make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN easy_install pip
RUN pip install \
sphinx \
sphinx_rtd_theme

VOLUME /opt/AMS-library/docs

WORKDIR /opt/AMS-library/docs
Loading

0 comments on commit 30ec7b3

Please sign in to comment.