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

Added support for naming Jargon apps in ips (main) #423

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

ganning127
Copy link
Collaborator

@ganning127 ganning127 commented Jul 18, 2023

feel free to leave feedback on how data is passed around / what to change.

in the Jargon app, we need to do something like

StartupPack.setApplicationName("NFSRODS");

to show the name

Copy link
Collaborator

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

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

Great first attempt!

@trel
Copy link
Member

trel commented Jul 18, 2023

Awesome.

Apologies for naive question.... why is setApplicationName not a method/feature of ifsys, rather than getIrodsSession()?

@ganning127
Copy link
Collaborator Author

why is setApplicationName not a method/feature of ifsys, rather than getIrodsSession()?

it could honestly be a method of either, we just need to modify the respective file. i originally added it as a method of the IRODSSessionobject (which is what getIrodsSession() returns) because it made sense that this irods "session" has its own name. I think placing it in StarterPack also makes sense. happy to change it

@korydraughn
Copy link
Collaborator

why is setApplicationName not a method/feature of ifsys, rather than getIrodsSession()?

it could honestly be a method of either, we just need to modify the respective file. i originally added it as a method of the IRODSSessionobject (which is what getIrodsSession() returns) because it made sense that this irods "session" has its own name. I think placing it in StarterPack also makes sense. happy to change it

I think this highly depends on what we want to support.

If clients are required to only appear under one name, then setting the name via a static method on the StartupPack makes a lot of sense. The static keyword means the variable is a member of the class rather than a particular instance of the class. All instances of the class share the value. And because the methods are part of the class, it's very easy to access/set the value.

If clients are allowed to appear under multiple names, then the member variables and functions shouldn't be marked static. That means each connection can have a different name within the same client. However, this makes it more difficult to set the value because the StartupPack is a low-level thing and isn't exposed to the users of the library (easily). You'd have to figure out how to pass the value through the layers to the StartupPack.

@trel
Copy link
Member

trel commented Jul 19, 2023

The only known/imagined use case, as far as I know, is to allow an application writer to 'name' their app.

I don't know of a scenario where I'd want to label individual connections from a particular app with different names.

Can we think of one? Metalnx having a 'main' vs. 'worker' threads? Or NFSRODS doing 'active' vs. 'background' or 'precache' work?

@korydraughn
Copy link
Collaborator

That's where I landed as well.

I don't think there's much value in allowing each connection to have a different name. It is only a nice to have. If we allowed this, then we'd have to establish naming rules so people don't show up with weird schemes.

Good logging removes the need for individually named connections.

I vote we only let users set a single name for all connections. Keeps things simple.

@trel
Copy link
Member

trel commented Jul 19, 2023

agreed. name the app, not the connection.

@ganning127 ganning127 marked this pull request as ready for review July 19, 2023 16:53
.gitignore Outdated Show resolved Hide resolved
Copy link
Collaborator

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

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

We're close. We're going to have to run the Jargon test suite before this can be merged.

@korydraughn
Copy link
Collaborator

Once the code passes review.

Take a swing at running the Jargon test suite. You can find instructions at https://github.com/DICE-UNC/jargon/tree/master/docker-test-framework.

@ganning127
Copy link
Collaborator Author

ganning127 commented Jul 20, 2023

The testing framework isn't working for me (both latest and 4-2). In 4-2, when running docker-compose up, I get the following error:

irods-catalog-consumer-resource1  | Traceback (most recent call last):
irods-catalog-consumer-resource1  |   File "/var/lib/irods/scripts/setup_irods.py", line 515, in main
irods-catalog-consumer-resource1  |     setup_server(irods_config,
irods-catalog-consumer-resource1  |   File "/var/lib/irods/scripts/setup_irods.py", line 139, in setup_server
irods-catalog-consumer-resource1  |     IrodsController(irods_config).start(test_mode=test_mode)
irods-catalog-consumer-resource1  |   File "/var/lib/irods/scripts/irods/controller.py", line 197, in start
irods-catalog-consumer-resource1  |     six.reraise(IrodsError, e, sys.exc_info()[2])
irods-catalog-consumer-resource1  |   File "/var/lib/irods/scripts/irods/six.py", line 672, in reraise
irods-catalog-consumer-resource1  |     raise value
irods-catalog-consumer-resource1  |   File "/var/lib/irods/scripts/irods/controller.py", line 189, in start
irods-catalog-consumer-resource1  |     raise IrodsError('iRODS server failed to start.')
irods-catalog-consumer-resource1  | irods.exceptions.IrodsError: iRODS server failed to start.
irods-catalog-consumer-resource1  | Please confirm [yes]: 

In latest, when running docker-compose up, I get no errors, but when running mvn clean install test I get an error about a dependency not being able to be resolved.

After discussing with Kory, we've decided to skip the testing framework for now (this PR compiles into a .jar fine, and works with NFSRODS when naming). Happy to leave this PR open until testing framework is fixed if needed.

Will squash & clean up PR in meantime

@trel
Copy link
Member

trel commented Jul 21, 2023

looking very good

Copy link
Collaborator

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

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

Good stuff!

We'll work out the test situation before adding the pound and merging.

@korydraughn
Copy link
Collaborator

@ganning127 I created PR #424 to address the test issue reported here. Please try to run the tests using that and let us know if it allows you to make more progress.

@ganning127
Copy link
Collaborator Author

From our discussion on Zoom, something is hanging on docker-compose up for me. Not sure why. Will await test results from your machine!

Copy link
Collaborator

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

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

All tests pass.

Consider changing commit message to something like ...

[407] Jargon apps can now report their name to iRODS server for ips.

Please add the pound too.

@ganning127
Copy link
Collaborator Author

changed commit message and added #

@korydraughn korydraughn merged commit 8d949c4 into DICE-UNC:master Aug 8, 2023
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.

3 participants