Skip to content

Improve directory and startup#29

Merged
PJEstrada merged 7 commits intomainfrom
improve-directory-and-startup
Jun 17, 2022
Merged

Improve directory and startup#29
PJEstrada merged 7 commits intomainfrom
improve-directory-and-startup

Conversation

@anthony-chaudhary
Copy link
Member

Fixes

  1. Startup not hanging on directory setting
  2. Dataset list errors

Refactors

  1. Dataset usage

-> Before we were using the json which introduced some potential confusion
now it uses the directory object
-> Move functions inside class
-> Move default setting inside here... the API returning default in that way still not best but working in existing pattern
-> move default dir and label setting to optional
and more cleanly define at init instead of inside auth
-> use new directory class
-> use new get_directory_list()
-> get dir now checks if none
-> Added print statements for now since still so much changing but those can be optional log statements in future of course
only schema is needed not directory id
(changing API side too)
only needed in some cases, heavy requirement to put here
init_file_ids asumes the id was already set
but for now refresh_from_dict pattern means the id is set after init
so refactor `init_files()` and call it after...

We will need to work on this more

Luckily at least now it's refactored to `convert_json_to_sdk_object()` so we have it only in one place
response = requests.get(self.host + endpoint,
params = params,
headers = {'directory_id': str(self.directory_id)},
headers = {'schema_id': str(schema_id)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Anthony!
I'm wondering if we can remove the headers param too? It seems that we are already sending it in the query params. As seen here I feel there's nowhere we use the schema_id in the header: https://github.com/diffgram/diffgram/blob/29067ea49f4a8bd770ce8cd0b2220a0e5cd9420b/default/methods/annotation/labels/view.py#L36

And 2nd reason for moving away from custom headers is that we need to add custom ingresses rules to the nginx ingress in the k8s context like this:

https://github.com/diffgram/diffgram-helm/blob/fdc0c50fae882ac2a9cfb3c72d5da34e85fe53d5/templates/ingress.yaml#L28

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey Pablo That makes sense! Agree 100%

@PJEstrada PJEstrada merged commit 0b988ea into main Jun 17, 2022
@PJEstrada PJEstrada deleted the improve-directory-and-startup branch June 17, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants