Skip to content

Commit

Permalink
fix(config,pipeline): allow no config file and fix required pipeline …
Browse files Browse the repository at this point in the history
…recipe (#43)

Because

- allow better user experience when setting target host and api token 

This commit

- make config file optional and allow setting default host and api token
during runtime
- fix mandatory `recipe` argument even with existing resource
- bump protogen-python version

Resolves INS-2505
  • Loading branch information
heiruwu authored Nov 7, 2023
1 parent d32fb83 commit 5290868
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions instill/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def save(self) -> None:
c,
)

def set_token(self, alias: str, token: str) -> None:
if self._config.hosts is not None:
self._config.hosts[alias].token = token
self.save()
def set_default(self, url: str, token: str, secure: bool):
self._config.hosts["default"] = _InstillHost(
url=url, secure=secure, token=token
)


global_config = Configuration()
Expand Down
2 changes: 1 addition & 1 deletion instill/protogen
2 changes: 1 addition & 1 deletion instill/resources/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(
self,
client: InstillClient,
name: str,
recipe: pipeline_interface.Recipe,
recipe: pipeline_interface.Recipe | None = None,
) -> None:
super().__init__()
self.client = client
Expand Down

0 comments on commit 5290868

Please sign in to comment.