Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

[CORE-1601] add hosting files upload#35

Merged
opalczynski merged 11 commits intodevelopfrom
CORE-1601
Jul 26, 2016
Merged

[CORE-1601] add hosting files upload#35
opalczynski merged 11 commits intodevelopfrom
CORE-1601

Conversation

@opalczynski
Copy link
Copy Markdown
Contributor

@opalczynski opalczynski commented Jul 22, 2016

CI will always failt till the next Python Library release - 5.3, which will support hosting.

@opalczynski opalczynski changed the title [CORE-1601][WIP] add hosting files upload [CORE-1601] add hosting files upload Jul 25, 2016
@opalczynski
Copy link
Copy Markdown
Contributor Author

@23doors @zhebr @ilu2112 Anyone? :)

Comment thread README.rst Outdated

::

syncano hosting <instance_name> --list-files <domain>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for now we should hide parameter as it doesn't make sense just yet

@23doors
Copy link
Copy Markdown
Member

23doors commented Jul 26, 2016

I would suggest that we simplify the flow for now.
Remove:
syncano hosting <instance_name> --list
syncano hosting <instance_name> --create --label <new_label>
and parameter from other places.

And instead when user does:
syncano hosting <instance_name> --publish <base_dir>
then check if there is a hosting with domain=default, if not create it (with auto generated label like: "Default hosting") and use that for publish.

As we won't have custom domain SSL support from the start, this should make it easier to use.
And once we have custom domains we could just add --domain parameter to publish (and if hosting with specific domain doesn't exist, ask if it should be created automatically).

We don't really care about list/create that much

@opalczynski
Copy link
Copy Markdown
Contributor Author

OK :) No problem, changes on the way.

…ist hostings, and create hosting; add auto-create when publishing the static files (if no default hosting in instance is present);
Comment thread syncano_cli/hosting/utils.py Outdated
hosting.upload_file(path=file_path, file=upload_file)

uploaded_files.append(file_path)
time.sleep(1) # avoid throttling;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if sleep is needed here but if we're dealing with 1 API request (and sleep after each one) then sleep(0.02) is enough (as it still gives us less than 60/s at best). Once we support retry-after in python lib, we can remove it altogether.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this throttling thing is a little bit tricky - because client have no information about other requests (made by others clients) - so your idea to implement retry-after is the best way to handle it (servers knows how many requests should be handled - from all clients).

Will change to 0.02 here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sleep in client code is still prone to errors as like you said - there can be other requests going on. Retry-after can actually be a good remedy for that.

@23doors
Copy link
Copy Markdown
Member

23doors commented Jul 26, 2016

lgtm! 👍

@opalczynski opalczynski merged commit cbb7ade into develop Jul 26, 2016
@opalczynski opalczynski deleted the CORE-1601 branch July 26, 2016 14:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants