Comments (9)
Hey pawel, thanks alot for the feedback!
I haven't used ScrapyRT so far. What does deploying a project to it mean? From the docs it looks to me like you need to run it within an existing Scrapy project, and that there's no endpoint to overwrite the project. Did shub
use to work with it?
In the past if I had default apikey it was used for all endpoints
Ah, hadn't thought of that. Any objections to reverting to this behaviour? (/cc @pablohoffman @dangra @eliasdorneles @josericardo)
from shub.
Hey @jdemaeyer
there are actually two issues here:
- not using default apikey if you do shub deploy name_of_project
- scrapyrt
1 is definitely more important IMO. If I have "default" apikey I would expect it to be "default" so that it is used when deploying to all projects I deploy to. Otherwise I will have to define and store same apikey for multiple projects which seems inconvenient for me (because I have 13 projects).
2 is less important. We use shub as parasites so we can accommodate all changes no problem. I see error is probably because there is no actual integer "project_id":https://github.com/scrapinghub/shub/blob/master/shub/config.py#L91 we can probably add some "project_id" if it's needed if project_id must be integer. Are there any important reasons why project is is integer?
What does deploying a project to it mean?
deploy is just POST with egg to "addversion" endpoint with Basic Auth header. It is not used in open source version it is only used in some internal SH projects (I know about 2 of them).
Did shub use to work with it?
yes, it worked fine
EDIT:
and I see it still works fine if I add some fake "project_id"
Perhaps you could consider validating config when migrating? e.g. I have following in scrapinghub.yml
projects
realtime: realtime/realtime
this was generated automatically. After replacing above with:
realtime: realtime/00
it works fine.
from shub.
1 is definitely more important IMO. If I have "default" apikey I would expect it to be "default" so that it is used when deploying to all projects I deploy too. Otherwise I will have to define and store same apikey for multiple projects which seems inconvenient for me.
Ohh sorry, I just saw that your scrapinghub.yml
is a little misconfigured. You don't need to define an API key per project, but per endpoint. And you don't have to specify the endpoint if it is the default one. I.e. it should look more like this:
much neater, eh? :) the default API key will be used now for all projects that don't specify an extra endpoint
from shub.
Are there any important reasons why project is is integer?
It's what Scrapy Cloud uses to designate projects. In shub
its used to distinguish between target that is defined in scrapinghub.yml
but was mistyped (shub deploy prof
instead of prod
) and a target that wasn't defined in scrapinghub.yml
but is still valid (e.g. shub deploy 12345
)
from shub.
Ohh sorry, I just saw that your scrapinghub.yml is a little misconfigured. You don't need to define an API key per project, but per endpoint.
I used default version generated by shub from scrapy.cfg. I didnt edit anything manually. So you say I should remove apikey part?
I just did that and I still get: Error: Could not find API key for endpoint prod.
from shub.
It's what Scrapy Cloud uses to designate projects. In shub its used to distinguish between a mistyped target (shub deploy prof instead of prod) and a valid target that is a SH project but doesn't have a shortcut defined scrapinghub.yml (e.g. shub deploy 12345)
sounds good I can just add some fake id see my edit here: #112 (comment)
from shub.
Uh I see where this went wrong: the migration got confused because you use http
(instead of https
) for deploying, I'll fix that :)
So you say I should remove apikey part?
Nono, the API keys are fine. You need to remove the endpoints from your project definitions. I.e. ad-hoc: ad-hoc/12345
should be ad-hoc: 12345
. I'll update the migration wizard in a minute, let's try if it works automatically then :)
sounds good we can just add some fake id see my edit here: #112 (comment)
could you give me one of the scrapy.cfg
sections that you use for ScrapyRT?
from shub.
You need to remove the endpoints from your project definitions. I.e. ad-hoc: ad-hoc/12345 should be ad-hoc: 12345. I'll update the migration wizard in a minute, let's try if it works automatically then :)
do I need to remove this manually or can I just wait for update to shub that will migrate me nicely to proper scrapinghub.yml?
from shub.
TBH, I am not sure to stay backward compatible between SH deploys and ScrapyRT, for now it is possible because both are using the egg-base deploys inherited from ScrapyD but in the long term I doubt we can keep the promise of shub->scrapyrt compatibility.
from shub.
Related Issues (20)
- Command to deploy and schedule in one command HOT 1
- deploy --build-egg deploys despite help message HOT 2
- IndexError on `shub image deploy`
- `Shub deploy` eggbased-entrypoint and run-pipcheck: no such file or directory
- shub deploy with pipfile doesn't add sources and fails to deploy from index other than pypi HOT 4
- AttributeError: type object 'Callable' has no attribute '_abc_registry' HOT 1
- shub deploy does not run on windows HOT 5
- KeyError for `shub log` in Python 3.8/3.9 HOT 1
- Add CLI parameters to forward to `--build-arg`
- Allow dots in args names
- Incorrect API Key generation URL HOT 3
- shub image upload with arg --apikey doesn't work
- Output of `pwd_git_version` produces invalid Docker tag name
- relax click dependency to make it possible to satisfy other project dependencies
- relax click dependency to make it possible to satisfy other project dependencies HOT 2
- drop support for Python 2.7, 3.5, 3.6
- Configure the latest Scrapy stack by default
- Add support for Python 3.10 HOT 2
- pipenv.utils.convert_deps_to_pip removed HOT 3
- Desktop notification after the deploy finishes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shub.