You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to extend the duplicate_space method in hf_api.py. Currently, repository and private parameters are sent in the payload. New parameters should be supported as well:
hardware: used to request hardware for the duplicated Space. Must be of type SpaceHardware.
sleepTimeSeconds: set a custom sleep time if upgraded hardware is used. Must be of type int. See set_space_sleep_time method as an example.
secrets: list of secrets to set on the Space
variables: list of variables to set on the Space
For secrets and variables, input type must be List[Dict[str, str]]. For each secret/variable, key and value are mandatory. A third item description is optional. Example: [{"key": "MY_SECRET_KEY_1", "value": "MY_SECRET_VALUE_1"}, {"key": ..., "value": ..., "description": "This is a description."}, ...]. Description is then displayed in the UI for a better user experience.
By default, all parameters are Optional in Python with default value None. Value must be sent in json payload only if not None.
Once implemented, tests must be added to HfApiDuplicateSpaceTest class (in test_hf_api.py). 1 test for hardware + sleep_time , 1 test for storage and 1 test for secrets + variables should be enough.
Similarly to the duplicate endpoint, config values like hardware, storage, sleep time, secrets and variables should be supported on the create_repo endpoint. Requirements are exactly the same as above.
The text was updated successfully, but these errors were encountered:
Wauplin
changed the title
Handle hardware and secrets when duplicating repos
Handle hardware, secrets and variables when duplicating repos
Jul 11, 2023
Wauplin
changed the title
Handle hardware, secrets and variables when duplicating repos
Handle hardware, secrets and variables when creating or duplicating repos
Jul 11, 2023
Wauplin
changed the title
Handle hardware, secrets and variables when creating or duplicating repos
Handle hardware, storage, secrets and variables when creating or duplicating repos
Jul 11, 2023
With the new reworked duplicate modal, one can set both hardware, storage, secrets and variables directly when duplicating a Space. We should reflect that in
huggingface_hub
. See https://github.com/huggingface/moon-landing/pull/6159 (internal link).cc @SBrandeis
Requested features in this issue can be implemented in separate PRs if it makes it easier.
duplicate_repo
create_repo
duplicate_repo
create_repo
duplicate_repo
create_repo
EDIT: everything got implemented in #1625 by @martinbrose !
The idea is to extend the
duplicate_space
method in hf_api.py. Currently,repository
andprivate
parameters are sent in the payload. New parameters should be supported as well:hardware
: used to request hardware for the duplicated Space. Must be of typeSpaceHardware
.storageTier
: used to request persistent storage for the duplicated Space. Must be of typeSpaceStorage
(see Add support for Space Persistent Storage #1553)sleepTimeSeconds
: set a custom sleep time if upgraded hardware is used. Must be of typeint
. Seeset_space_sleep_time
method as an example.secrets
: list of secrets to set on the Spacevariables
: list of variables to set on the SpaceFor secrets and variables, input type must be
List[Dict[str, str]]
. For each secret/variable,key
andvalue
are mandatory. A third itemdescription
is optional. Example:[{"key": "MY_SECRET_KEY_1", "value": "MY_SECRET_VALUE_1"}, {"key": ..., "value": ..., "description": "This is a description."}, ...]
. Description is then displayed in the UI for a better user experience.By default, all parameters are
Optional
in Python with default valueNone
. Value must be sent in json payload only if not None.Once implemented, tests must be added to
HfApiDuplicateSpaceTest
class (in test_hf_api.py). 1 test for hardware + sleep_time , 1 test for storage and 1 test for secrets + variables should be enough.Similarly to the duplicate endpoint, config values like hardware, storage, sleep time, secrets and variables should be supported on the
create_repo
endpoint. Requirements are exactly the same as above.The text was updated successfully, but these errors were encountered: