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

[irods/irods#7229] Add support for iRODS 5 #231

Merged
merged 5 commits into from
Dec 5, 2024
Merged

Conversation

korydraughn
Copy link
Contributor

@korydraughn korydraughn commented Nov 7, 2024

Related to irods/irods#7988.

This is a WIP.

The change to the shared memory is required because iRODS 5 temporarily allocates more shared memory during a reload of the configuration.

Feel free to ask questions and provide feedback.

@korydraughn korydraughn changed the title Add support for iRODS 5 [irods/irods#7229] Add support for iRODS 5 Nov 7, 2024
@korydraughn korydraughn force-pushed the irods5 branch 2 times, most recently from e2c0b4f to 44cdd5d Compare November 13, 2024 02:02
@korydraughn
Copy link
Contributor Author

I've confirmed the changes in this PR work.

There was one thing that caught my eye. When using -vvv, I noticed a strange message which seemed to imply the IrodsController replacement for irodsctl wasn't working. This was observed in the output during setup. I'm not entirely sure it was real. The results of the tests appear to be correct.

I believe it was during federation testing.

@korydraughn korydraughn marked this pull request as ready for review November 13, 2024 02:11
@korydraughn
Copy link
Contributor Author

I've confirmed the changes in this PR work.

There was one thing that caught my eye. When using -vvv, I noticed a strange message which seemed to imply the IrodsController replacement for irodsctl wasn't working. This was observed in the output during setup. I'm not entirely sure it was real. The results of the tests appear to be correct.

I believe it was during federation testing.

The following is from a unit test run for iRODS 4.3.3 (using this PR) and is exactly the message I was referring to. The test passed BTW.

2024-11-13 08:39:01,619 - setting up iRODS catalog provider [ubuntu-2004-postgres-14_irods-catalog-provider_1]                                                                         
2024-11-13 08:39:01,619 - executing on [ubuntu-2004-postgres-14_irods-catalog-provider_1] [python3 -c 'from scripts.irods.controller import IrodsController; IrodsController().stop()']
2024-11-13 08:39:01,623 - http://localhost:None "POST /v1.46/containers/52d5b5581ff...2058e6c0aa/exec HTTP/1.1" 201 74                         
2024-11-13 08:39:01,627 - http://localhost:None "POST /v1.46/exec/84fb2a73d01...f71a192b7b58/start HTTP/1.1" 101 0                               
2024-11-13 08:39:01,629 - unable to find user irods: no matching entries in passwd file     

Notice the last line from the logs above. It is produced by the following:

try:
if stop_irods(container) != 0:
logging.debug(f'[{container.name}] failed to stop iRODS server before setup')
except Exception as e:
error_msg = f'[{container.name}] failed to stop iRODS server before setup: {str(e)}'
if "unable to find user irods" in str(e):
# If the user didn't exist at this point then the service probably wasn't started.
logging.debug(error_msg)
else:
logging.error(error_msg)
raise e

I then did the same thing again, but using tip-of-main for the testing environment and got this output.

2024-11-13 09:29:58,974 - setting up iRODS catalog provider [ubuntu-2004-postgres-14_irods-catalog-provider_1]                                                
2024-11-13 09:29:58,974 - executing on [ubuntu-2004-postgres-14_irods-catalog-provider_1] [/var/lib/irods/irodsctl stop]                                      
2024-11-13 09:29:58,979 - http://localhost:None "POST /v1.46/containers/b74d1b63aef4bd...a8a9e77e3f5c026f0e/exec HTTP/1.1" 201 74
2024-11-13 09:29:58,982 - http://localhost:None "POST /v1.46/exec/a5728b962df32a38fdc...fc055d783447e6/start HTTP/1.1" 101 0      
2024-11-13 09:29:58,984 - unable to find user irods: no matching entries in passwd file                                                                       

Notice the use of irodsctl and the last log message.

Based on the output of each run, I'm sure this is expected/intentional. Therefore, everything is working correctly.

@trel
Copy link
Member

trel commented Nov 13, 2024

but i don't see in the log ... failed to stop iRODS server...

@korydraughn
Copy link
Contributor Author

That log message appears after those lines.

@trel
Copy link
Member

trel commented Nov 13, 2024

oh, okay - so we're failing to stop(), and that's 'okay'?

@korydraughn
Copy link
Contributor Author

That code snippet is designed to cover multiple situations based on the state of the world. Based on what I saw for tip-of-main for this repo, I think we're okay.

Copy link
Contributor

@alanking alanking left a comment

Choose a reason for hiding this comment

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

Looks good overall. Just some suggested improvements.

irods_testing_environment/irods_config.py Outdated Show resolved Hide resolved
irods_testing_environment/irods_config.py Show resolved Hide resolved
irods_testing_environment/irods_setup.py Show resolved Hide resolved
irods_testing_environment/odbc_setup.py Outdated Show resolved Hide resolved
@trel
Copy link
Member

trel commented Nov 13, 2024

do we have a linter we can run? something that will clean this kind of thing up?

@alanking
Copy link
Contributor

Created #233 for linter workflow. I also kinda addressed all the problems it found in this branch: https://github.com/alanking/irods_testing_environment/tree/ruffaction Not sure if we actually want those changes but there they are.

@korydraughn
Copy link
Contributor Author

I say open a PR for that.

@alanking
Copy link
Contributor

Okay, I opened the PR here: #234 Left it in draft in case we wanted to put this in first.

@korydraughn
Copy link
Contributor Author

korydraughn commented Nov 14, 2024

Yes, I'd like to get this PR merged first unless you feel it's easier to merge the one you just opened. The edits in this PR aren't difficult to apply on top of yours.

Thoughts?

@alanking
Copy link
Contributor

No preference. I don't think the merge conflict will be too bad, so I don't mind dealing with it in the other PR. In other words, let's put this one in first.

@trel
Copy link
Member

trel commented Nov 14, 2024

agreed - linter/formatter after please.

@korydraughn
Copy link
Contributor Author

Attached issue numbers to commits.

Just one more comment to resolve before this is ready.

Copy link
Contributor

@alanking alanking left a comment

Choose a reason for hiding this comment

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

If there's no further reservations about the ODBC drivers, I say # it.

@korydraughn
Copy link
Contributor Author

Still thinking about the ODBC driver issue. I'm going to back that change out so we can investigate it more.

The other changes are fine.

@korydraughn
Copy link
Contributor Author

Don't merge this yet. Got the wrong issue number for irods/irods.

…ion of federation initialization.

Changes to config files in iRODS 5 are not automatically loaded,
therefore, the testing environment must instruct the iRODS 5 server to
reload its config files before launching the tests.
…on for containers from 64mb to 100mb.

The tests for iRODS 5 lean heavily on configuration reloading. This
operation results in at least two agent factories appearing, increasing
the amount of shared memory needed by the container. This commit makes
it so that the tests don't terminate due to a server reload.
… irodsctl.

irodsctl was removed in iRODS 5. This commit replaces the testing
environment's use of irodsctl with the python code invoked via irodsctl.
@korydraughn
Copy link
Contributor Author

Removed the ODBC driver commit and fixed issue numbers.

Ready for merging.

@alanking alanking merged commit 56e7c81 into irods:main Dec 5, 2024
@korydraughn korydraughn deleted the irods5 branch December 5, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants