Skip to content
This repository has been archived by the owner on May 18, 2018. It is now read-only.

s2i assemble script fails due to exceeding github API rate limit #29

Closed
juanvallejo opened this issue Mar 17, 2017 · 4 comments
Closed

Comments

@juanvallejo
Copy link

juanvallejo commented Mar 17, 2017

Assemble script fails while parsing the OC_BINARY_URL due to hitting API rate limit:

$ python -c "import requests;print [s for s in [r for r in requests.get('https://api.github.com/repos/openshift/origin/releases').json() if not r['prerelease'] and '1.4' in r['name']][0]['assets'] if 'linux-64' in s['browser_download_url']][0]['browser_download_url']"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: string indices must be integers

If we run just the part that returns the json response:

$ python -c "import requests;requests.get('https://api.github.com/repos/openshift/origin/releases').json()"

{u'documentation_url': u'https://developer.github.com/v3/#rate-limiting',
 u'message': u"API rate limit exceeded for 66.187.233.202. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"}
@aweiteka
Copy link
Owner

We need to support unauthenticated requests, which I validated are limited to 60 requests per hour per IP address.

@jcpowermac the logic you implemented here is slick. The user doesn't have to know about a specific release. I'd like to retain that. Do you think we could do less looping or maybe maintain a hard-coded link to a specific release?

@codificat how have you modified the assemble script to install oc via RPM?

@jcpowermac
Copy link
Collaborator

@aweiteka I didn't know that API had a limit ... let me figure out a fix.

@codificat
Copy link
Collaborator

In a Dockerfile that builds upon playbook2image and is RPM-based the idea is to not invoke the assemble script at build time. In that type of Dockerfile everything is installed from packages, and dependencies would not be an exception. For example, the Dockerfile.rhel7 for the openshift-ansible image (PR still pending) would yum install openshift-ansible-playbooks to get the "source" in, and it would also install atomic-openshift-clients at the same time to pull in oc.

I'll submit a PR with changes to the example Dockerfile.advanced and associated doc to explain that.

@aweiteka
Copy link
Owner

@juanvallejo issue #30 should resolve this. New base image has been pushed to registry, docker.io/aweiteka/playbook2image.

@aweiteka aweiteka closed this as completed Apr 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants