Skip to content
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

ENH: Add operating system field to event-tracklog #440

Merged
merged 1 commit into from
Feb 13, 2024
Merged

ENH: Add operating system field to event-tracklog #440

merged 1 commit into from
Feb 13, 2024

Conversation

janbjorge
Copy link
Contributor

@janbjorge janbjorge commented Jan 30, 2024

Resolves: #387

Schema will be updated as soon as we decide to publish a new schema

python -c"from pprint import pp; from fmu.dataio._metadata import generate_meta_tracklog; pp(generate_meta_tracklog())"
[{'datetime': '2024-02-12T13:46:27.159655Z',
  'event': 'created',
  'user': {'id': 'xxxxxx'},
  'sysinfo': {'fmu-dataio': {'version': '2.1.1.dev3+gbb36c6a'},
              'operating_system': {'hostname': 'AC-W6JD2YH37N',
                                   'operating_system': 'macOS-14.2.1-arm64-arm-64bit',
                                   'release': '23.2.0',
                                   'system': 'Darwin',
                                   'version': 'Darwin Kernel Version 23.2.0: '
                                              'Wed Nov 15 21:55:06 PST 2023; '
                                              'root:xnu-10002.61.3~2/RELEASE_ARM64_T6020'}}}]

@@ -275,8 +297,8 @@ class TracklogEvent(BaseModel):
examples=["created", "updated", "merged"],
)
user: User
sysinfo: Optional[SystemInformation] = Field(
default=None,
sysinfo: SystemInformation = Field(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sysinfo will always be present and always contain the platform field.

@janbjorge janbjorge marked this pull request as ready for review February 6, 2024 15:07
@janbjorge janbjorge removed the request for review from mferrera February 7, 2024 10:05
@perolavsvendsen
Copy link
Member

Is platform the best word? (operating_system?) (Platform means many things, and especially in the oil industry, the word "platform" has a few additional meanings.)

How do we know that this works on all platforms? Tested so far on Mac, I assume. Those that comes to mind:

  • Unix (RGS)
  • Unix (LSF)
  • Unix (Radix, Azure, etc)
  • Windows

@perolavsvendsen
Copy link
Member

Are there security concerns to take into account? These data are to be shared with externals, we must assume that they will be made available to anyone. Are we OK exposing exactly which platforms we are running FMU on internally?

@janbjorge
Copy link
Contributor Author

Is platform the best word? (operating_system?) (Platform means many things, and especially in the oil industry, the word "platform" has a few additional meanings.)

How do we know that this works on all platforms? Tested so far on Mac, I assume. Those that comes to mind:

* [ ]  Unix (RGS)

* [ ]  Unix (LSF)

* [ ]  Unix (Radix, Azure, etc)

* [ ]  Windows

Its a builtin python package, i would be amazed if the does not work on all python supported platforms. However, how can i test for other platforms / operating systems?

@janbjorge
Copy link
Contributor Author

Are there security concerns to take into account? These data are to be shared with externals, we must assume that they will be made available to anyone. Are we OK exposing exactly which platforms we are running FMU on internally?

Good question, if there is a known security weakness in a version we using this could potentially be used as a discriminator.

@jcrivenaes
Copy link
Collaborator

Are there security concerns to take into account? These data are to be shared with externals, we must assume that they will be made available to anyone. Are we OK exposing exactly which platforms we are running FMU on internally?

There should be people in Equinor to ask about this...

@jcrivenaes
Copy link
Collaborator

Is platform the best word? (operating_system?) (Platform means many things, and especially in the oil industry, the word "platform" has a few additional meanings.)
How do we know that this works on all platforms? Tested so far on Mac, I assume. Those that comes to mind:

* [ ]  Unix (RGS)

* [ ]  Unix (LSF)

* [ ]  Unix (Radix, Azure, etc)

* [ ]  Windows

Its a builtin python package, i would be amazed if the does not work on all python supported platforms. However, how can i test for other platforms / operating systems?

Yes agree it should work in general. For me, this is "nice to have" information; not something "critical" we need to make dataio/sumo work.

Copy link
Collaborator

@jcrivenaes jcrivenaes left a comment

Choose a reason for hiding this comment

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

OK for me

@janbjorge
Copy link
Contributor Author

Change since last review.

  • renamed platform -> operating_system
  • Added test
  • Moved object initialization to _metadata.py

@janbjorge
Copy link
Contributor Author

Is platform the best word? (operating_system?) (Platform means many things, and especially in the oil industry, the word "platform" has a few additional meanings.)
How do we know that this works on all platforms? Tested so far on Mac, I assume. Those that comes to mind:

* [ ]  Unix (RGS)

* [ ]  Unix (LSF)

* [ ]  Unix (Radix, Azure, etc)

* [ ]  Windows

Its a builtin python package, i would be amazed if the does not work on all python supported platforms. However, how can i test for other platforms / operating systems?

Yes agree it should work in general. For me, this is "nice to have" information; not something "critical" we need to make dataio/sumo work.

I checked out the source for plaform quick, and i see code for windows in there. So for now, i think its safe to assume so.

https://github.com/python/cpython/blob/3.12/Lib/platform.py

Copy link
Member

@perolavsvendsen perolavsvendsen left a comment

Choose a reason for hiding this comment

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

I think this is fine, but we should confirm the security implications before we merge.

Copy link
Member

@perolavsvendsen perolavsvendsen left a comment

Choose a reason for hiding this comment

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

Based on inputs from community, I consider the potential risk very low. Still a question about how much is needed to include here, but that can also be adjusted over time.

@janbjorge janbjorge merged commit 61f2a6b into equinor:main Feb 13, 2024
13 checks passed
@janbjorge janbjorge deleted the add-platform branch February 13, 2024 08:24
@janbjorge janbjorge changed the title ENH: Add platform field to event-tracklog ENH: Add operating system field to event-tracklog Feb 13, 2024
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.

Add system information to metadata
3 participants