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

DAOS-14698 crtl: Create container with attributes #15300

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

knard-intel
Copy link
Contributor

@knard-intel knard-intel commented Oct 11, 2024

Description

Add new option attr to daos cont create allowing to define container user attributes.

Before requesting gatekeeper:

  • Two review approvals and any prior change requests have been resolved.
  • Testing is complete and all tests passed or there is a reason documented in the PR why it should be force landed and forced-landing tag is set.
  • Features: (or Test-tag*) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.
  • Commit messages follows the guidelines outlined here.
  • Any tests skipped by the ticket being addressed have been run and passed in the PR.

Gatekeeper:

  • You are the appropriate gatekeeper to be landing the patch.
  • The PR has 2 reviews by people familiar with the code, including appropriate owners.
  • Githooks were used. If not, request that user install them and check copyright dates.
  • Checkpatch issues are resolved. Pay particular attention to ones that will show up on future PRs.
  • All builds have passed. Check non-required builds for any new compiler warnings.
  • Sufficient testing is done. Check feature pragmas and test tags and that tests skipped for the ticket are run and now pass with the changes.
  • If applicable, the PR has addressed any potential version compatibility issues.
  • Check the target branch. If it is master branch, should the PR go to a feature branch? If it is a release branch, does it have merge approval in the JIRA ticket.
  • Extra checks if forced landing is requested
    • Review comments are sufficiently resolved, particularly by prior reviewers that requested changes.
    • No new NLT or valgrind warnings. Check the classic view.
    • Quick-build or Quick-functional is not used.
  • Fix the commit message upon landing. Check the standard here. Edit it to create a single commit. If necessary, ask submitter for a new summary.

Copy link

github-actions bot commented Oct 11, 2024

Ticket title is 'Creating daos container with dfuse cache settings.'
Status is 'In Review'
Labels: 'triaged,usability'
Errors are Unknown component
https://daosio.atlassian.net/browse/DAOS-14698

@knard-intel knard-intel force-pushed the ckochhof/dev/master/daos-14698 branch 2 times, most recently from 3a1167a to 7d8cdd0 Compare October 16, 2024 09:58
Add new option set-attr to daos cont create allowing to define container
user attributes.

Features: control dfuse
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
@daosbuild1
Copy link
Collaborator

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15300/4/testReport/

Update and add new functional tests.

Features: control dfuse container
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
@knard-intel knard-intel marked this pull request as ready for review October 21, 2024 10:27
@knard-intel knard-intel requested review from a team as code owners October 21, 2024 10:27
# Start the servers and agents
super().setUp()

def check_attrs(self, dfuse, container_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a helper function so should be "private" to the class.

Suggested change
def check_attrs(self, dfuse, container_name):
def _check_attrs(self, dfuse, container_name):

Copy link
Contributor Author

@knard-intel knard-intel Oct 21, 2024

Choose a reason for hiding this comment

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

  • Move check_attrs() to private.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Move check_attrs() to private.

Fixed with commit 865f2e5

src/tests/ftest/dfuse/container_attrs.py Show resolved Hide resolved
@daosbuild1
Copy link
Collaborator

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15300/6/testReport/

Integrate reviewers comments:
- Move check_attrs() to private

Features: control dfuse container
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
@daosbuild1
Copy link
Collaborator

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15300/7/testReport/

Comment on lines 189 to 190
duns_create_path_attr(daos_handle_t poh, const char *path, int count, char const *const names[],
void const *const values[], size_t const sizes[], struct duns_attr_t *attrp);
Copy link
Contributor

Choose a reason for hiding this comment

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

im not a fan of this new API. it might be useful to have something for the command line.
but for the API, it's not a big deal to do
daos_cont_create()
daos_cont_set_attr()
I would suggest to remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure to fully understand your comments.
Are you suggesting to remove duns_create_path_attr() and duns_create_path() functions or just the first one.
If we are just removing duns_create_path_attr(), then we will have two solutions from my understanding:

  1. Change the dfuse code to poll the attributes of its mounted containers.
  2. split the function duns_create_path_attr() to not create and bind the container in the same function. By this way, we will be able to use the function daos_cont_set_attr() between the two function calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

no you cannot remove duns_create_path()!
my question is why you are adding this new API (duns_crreate_path_attr()) ?
what is the challenge of doing:
duns_create_path()
daos_cont_set_attr()
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my understanding, doing this will not work as the attributes are cached inside DFuse after the binding.
Thus, when we will get back from duns_create_path() , the call to daos_cont_set_attr() will not be taken into account by DFuse.
@ashleypittman could you confirm this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've taken a closer look and think you're both right, having a new API doesn't seem like the right solution here, however I hadn't realised it was the same C function that both created the container and inserted it into the POSIX namespace.

The best path might be:
daos_cont_create()
daos_cont_set_attr()
duns_link_cont()

Copy link
Contributor Author

@knard-intel knard-intel Oct 21, 2024

Choose a reason for hiding this comment

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

I was not aware of the duns_link_cont() function, which for sure is a better solution.
Thanks @ashleypittman for the hints and @mchaarawi for the relevant remark :-)

  • Remove useless new function duns_create_path_attr()
  • Split sub container creation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not aware of the duns_link_cont() function, which for sure is a better solution. Thanks @ashleypittman for the hints and @mchaarawi for the relevant remark :-)

  • Remove useless new function duns_create_path_attr()
  • Split sub container creation

Fixed with commit 819b856

Copy link
Contributor

@kjacque kjacque left a comment

Choose a reason for hiding this comment

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

From the Go side, the approach looks fine to me. Will wait for the other requested changes to come through before approving.

src/control/cmd/daos/container.go Show resolved Hide resolved
@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15300/7/execution/node/1217/log

phender
phender previously approved these changes Oct 23, 2024
Integrate reviewers comments:
- Change tags from pr to daily_regression
- Add container type in the log message
- Add daos_cmd feature tag

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
phender
phender previously approved these changes Oct 24, 2024
…/daos-14698

Skip-func-hw-test-medium-md-on-ssd: false
Skip-nlt: true
Test-tag: DfuseContainerAttrs

Required-githooks: true
@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15300/15/execution/node/1120/log

@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15300/16/execution/node/491/log

Fix NLT uns_link test

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
…/daos-14698

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
Copy link
Contributor

@kjacque kjacque left a comment

Choose a reason for hiding this comment

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

Go changes LGTM.

Fix NLT fault injection issue

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15300/21/execution/node/1210/log

Copy link
Contributor

@ashleypittman ashleypittman left a comment

Choose a reason for hiding this comment

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

It would be good to add some attributes to the new container in the test_alloc_fail_cont_create function in NLT, this would check the unwinding code is correct in case of failure partway through.

rc = stat(path, &finfo);
if (rc) {
rc = errno;
D_ERROR("Failed to access new container: %d (%s)\n", rc, strerror(rc));
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is moved, not new code but it would be good to use the correct macros here. The S here stands for system, that is it's a errno.

Suggested change
D_ERROR("Failed to access new container: %d (%s)\n", rc, strerror(rc));
DS_ERROR(rc, "Failed to access new container");

Copy link
Contributor Author

@knard-intel knard-intel Nov 4, 2024

Choose a reason for hiding this comment

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

  • Use up to date logging macros

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Use up to date logging macros

Fixed with commit 0561a5b

Comment on lines +1329 to +1336
if (rc2 != -DER_SUCCESS) {
DL_ERROR(rc2, "failed to close container");
if (rc2 == -DER_NOMEM)
// Second close to properly handle fault injection
daos_cont_close(coh, NULL);
else if (rc == -DER_SUCCESS)
rc = daos_der2errno(rc2);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we'd designed out these hacks by now but perhaps there's still a few there. Container close would be a tricky one to re-try at a higher level.

Fix functional tests: ACL not properly set with dfs_link_cont()
function.

Integrate reviewers comments:
-  Use up to date logging macros

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
Improve deployment setting of the DfuseContainerAttrs functional test.

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
Improve deployment setting of the DfuseContainerAttrs functional test.

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
@knard-intel knard-intel self-assigned this Nov 4, 2024
@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15300/24/execution/node/1211/log

…/daos-14698

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15300/25/testReport/

Fix functional test test_dfuse_subcontainer_attrs.

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
Fix pylint errors.

Features: control dfuse container daos_cmd
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
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.

8 participants