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

Add Cylc Clean Support #323

Merged
merged 40 commits into from
Jun 17, 2022
Merged

Add Cylc Clean Support #323

merged 40 commits into from
Jun 17, 2022

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Feb 24, 2022

These changes close #299

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • No documentation update required.
  • No dependency changes.

@wxtim wxtim self-assigned this Feb 24, 2022
@wxtim wxtim added this to the 1.1.0 milestone Feb 24, 2022
@wxtim wxtim marked this pull request as draft February 24, 2022 16:52
@oliver-sanders
Copy link
Member

For the pool to be able to manage all operations centrally it should be a property of the uiserver (i.e. self.proc_pool = ProcessPoolExecutor(max_workers=None)) rather than created for each command (with ProcessPoolExecutor...).

There's a stop_extension method in the UIServer which can be used to close the pool on shutdown.

@wxtim
Copy link
Member Author

wxtim commented Feb 25, 2022

For the pool to be able to manage all operations centrally it should be a property of the uiserver (i.e. self.proc_pool = ProcessPoolExecutor(max_workers=None)) rather than created for each command (with ProcessPoolExecutor...).

There's a stop_extension method in the UIServer which can be used to close the pool on shutdown.

That makes more sense than what I was trying to do.

@wxtim wxtim marked this pull request as ready for review February 25, 2022 20:41
@oliver-sanders
Copy link
Member

Executor is looking good.

@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #323 (3299e00) into master (dcb91cc) will increase coverage by 0.59%.
The diff coverage is 66.26%.

@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   77.76%   78.36%   +0.59%     
==========================================
  Files          10       11       +1     
  Lines        1048     1137      +89     
  Branches      202      217      +15     
==========================================
+ Hits          815      891      +76     
- Misses        196      207      +11     
- Partials       37       39       +2     
Impacted Files Coverage Δ
cylc/uiserver/resolvers.py 54.10% <59.09%> (+12.35%) ⬆️
cylc/uiserver/app.py 84.48% <75.00%> (-0.34%) ⬇️
cylc/uiserver/schema.py 85.91% <100.00%> (+3.15%) ⬆️
cylc/uiserver/workflows_mgr.py 81.76% <0.00%> (-0.59%) ⬇️
cylc/uiserver/authorise.py 88.64% <0.00%> (-0.05%) ⬇️
cylc/uiserver/utils.py 100.00% <0.00%> (ø)
cylc/uiserver/data_store_mgr.py 65.00% <0.00%> (+3.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dcb91cc...3299e00. Read the comment docs.

Copy link
Contributor

@datamel datamel left a comment

Choose a reason for hiding this comment

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

I have manually tested this and am getting an error "'types.SimpleNamespace' object has no attribute 'remote_timeout'".

cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
@wxtim wxtim requested a review from datamel March 14, 2022 09:36
Copy link
Contributor

@datamel datamel left a comment

Choose a reason for hiding this comment

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

I've had this branch running today, using it to clean both remote and local workflows. I have read the code and run the tests. Working smoothly for me. Thanks @wxtim

except Exception as exc:
return cls._error(exc)
# Hard set remote timeout.
opts.remote_timeout = "600"
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor point but this defaults to 120 in cylc flow. Wonder if it would be worth making them consistent, for documentation purposes mainly.
I think 600 may seem like the better timeout than 120, since nfs and file deletions can perhaps take a while?

Copy link
Member Author

Choose a reason for hiding this comment

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

In the CLI 120 is the default, but the user can over-ride it.
In the UI I haven't exposed it to the user, so I think it's reasonable to set it longer.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason not to expose it to the user? (Happy to leave this as is for now, but perhaps there should be a question issue for how long the timeouts should be on the CLI vs UI and whether to expose it to user on the UI)

Copy link
Member Author

@wxtim wxtim May 31, 2022

Choose a reason for hiding this comment

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

I can't remember the reason, but I think @oliver-sanders and I agreed not to - I think it ought to be documented for discussion...

cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Coming back to this post RC2 release!

One small conflict.

cylc/uiserver/schema.py Outdated Show resolved Hide resolved
cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
@oliver-sanders oliver-sanders mentioned this pull request May 9, 2022
12 tasks
@wxtim wxtim marked this pull request as draft May 10, 2022 15:39
@wxtim wxtim marked this pull request as ready for review May 11, 2022 14:28
@wxtim wxtim requested a review from MetRonnie May 25, 2022 09:16
@wxtim
Copy link
Member Author

wxtim commented May 25, 2022

@MetRonnie Tagging you because Oliver is away.

except Exception as exc:
return cls._error(exc)
# Hard set remote timeout.
opts.remote_timeout = "600"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason not to expose it to the user? (Happy to leave this as is for now, but perhaps there should be a question issue for how long the timeouts should be on the CLI vs UI and whether to expose it to user on the UI)

cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
cylc/uiserver/resolvers.py Outdated Show resolved Hide resolved
@wxtim wxtim requested a review from MetRonnie June 1, 2022 09:14

class Arguments:
workflows = graphene.List(WorkflowID, required=True)
rm = graphene.String(
Copy link
Member

@MetRonnie MetRonnie Jun 1, 2022

Choose a reason for hiding this comment

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

Tested it out with rm and it failed. This should be a list of strings rather than a single string, I think

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes - according to the documentation it can be a colon-separated list of strings. I've added something to deal.

@wxtim wxtim requested a review from MetRonnie June 1, 2022 13:18
wxtim and others added 2 commits June 7, 2022 09:09
@wxtim wxtim requested a review from MetRonnie June 7, 2022 08:09
@oliver-sanders oliver-sanders removed their request for review June 13, 2022 09:20
…o add_clean_to_ui2

* 'add_clean_to_ui2' of github.com:wxtim/cylc-uiserver:
  Update cylc/uiserver/resolvers.py
  Update cylc/uiserver/resolvers.py
@oliver-sanders
Copy link
Member

LGTM: Merging with two approvals.

@oliver-sanders oliver-sanders merged commit 9f011ae into cylc:master Jun 17, 2022
@MetRonnie MetRonnie mentioned this pull request Jun 17, 2022
@wxtim wxtim deleted the add_clean_to_ui2 branch June 20, 2022 07:45
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.

clean: add cylc clean support
5 participants