-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files API #9
base: master
Are you sure you want to change the base?
Files API #9
Conversation
This is to the point where it could use some proper review. I had a lot of lessons-learned along the way. |
522d143
to
65667f2
Compare
I just noticed the files api uses |
elif isinstance(o, datetime.timedelta): | ||
return duration_iso_string(o) | ||
elif isinstance(o, (decimal.Decimal, uuid.UUID, Promise)): | ||
return str(o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str of a Promise doesn't sound right?
Also Promise
doesn't seem to be defined anywhere?
return data | ||
|
||
|
||
class ISODateTimeField(models.DateTimeField): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel there must be a better way to do this than copy paste this class across django apps.
@@ -73,7 +73,7 @@ def to_dict(self): | |||
opts = self._meta | |||
data = {} | |||
for f in chain(opts.concrete_fields, opts.private_fields, opts.many_to_many): | |||
if f.name is 'id': | |||
if f.name == 'id': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch :\
/datalake/admin/whats/: | ||
get: | ||
security: | ||
- jwt: ['admins'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unclear what this part of the tag will do?
What defines who an 'admin' is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admins
doesn't appear to be defined anywhere else?
This API relies on my fork of datalake-common library (datalake-common-dtkav).
planetlabs/datalake-common@master...dtkav:dist
The goal of the Files API is to:
What
model.Design:
DatalakeFile objects are just metadata, and contains a pointer to the content-id (cid) of a file.
The content-id is:
mutibase('base32', mutlihash('blake2b-16', blake2b(file_contents, digest_size=16)))
The
work-id
field can be any string (so users can include their own prefixes).However, there are a special set of
work-id
prefixes that correspond to objects in mission control.Adding files with these prefixes will make the files available from those objects directly.
A work-id looks like this:
mc-<model_name>.<uuid>
.Alternately, a user might be running jobs with jenkins and use something like:
jenkins-job.<id>
. These files would not be related to any objects in mission control, but users in the ecosystem can still leverage the datalake to store all of the files in one place.