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

.github/workflows: Added ubi8-nightly.yml #53

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

e10harvey
Copy link
Collaborator

  • Includes various fixes in examples.

Summary:

  - Includes various fixes in examples.
@e10harvey e10harvey requested review from bbean23 and braden6521 March 26, 2024 23:08
Copy link
Collaborator

@bbean23 bbean23 left a comment

Choose a reason for hiding this comment

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

Feel free to merge. I do, however, have a couple of minor thoughts that I would like you to respond to, as you have time.

- name: pytest-cov
working-directory: OpenCSP/example
run: |
python3 -m pip install -r ../requirements.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this create a new container every night? If that's the desired behavior, that seems good to me, because it will help us to catch dependency errors faster. If this doesn't create a new container every night, then maybe it should. Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This reasoning makes sense to me. I don't know the implications to runtime/using resources of this though. Those would be my only concerns but I'm not well versed in this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, this runs pip install in the container image.

A image would be built with something like: docker build ... or podman build .... For example, see https://github.com/sandialabs/OpenCSP/blob/main/.github/workflows/docker.yml.

Copy link
Collaborator

@bbean23 bbean23 Mar 28, 2024

Choose a reason for hiding this comment

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

That's more or less what I thought. Thanks!

Back to my original question, can we have a secondary container for the nightly tests that always updates to the latest packages? Really, I think the best set up would be:

  • one Ubi8 container for PR unit tests & example nightly tests
  • one Windows container for PR unit tests & example nightly tests
  • one Ubi8 container for "pip --update" unit+example nightly tests
  • one Windows container for "pip --update" unit+example nightly tests

All four containers should be created every time we merge to main. However, the second two containers should always be running with the latest version of all our dependencies, to try and catch dependency issues early.

What do you think @e10harvey? Is this a reasonable and achievable goal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bbean23: In general, I think this is a good idea. That being said, I think updating everything in the image every night is asking for trouble. If you would like to triage the nightlies when these fail, then I am OK with it. Otherwise, I think it would be best to setup a second nightly that updates everything in a separate image and runs examples + unit tests. Even with that setup, I am not volunteering for keeping this running : )

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, a second nightly is exactly what I'm proposing. And I agree, you shouldn't be necessarily responsible for making it work. In fact, it would be helpful for me to learn how to set up a container like this. I'll make a ticket to do so.

@@ -45,12 +45,16 @@ def example_scene_reconstruction(save_dir: str):
fig.savefig(join(save_dir, fig.get_label() + '.png'))


if __name__ == '__main__':
def example_driver():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was this change made? My preference is to have setup code like this contained to within the main statement. Is that incompatible with unit tests somehow?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is incompatible with unit tests, then can we do this instead?

def set_up():
    # Define output directory
    save_path = join(dirname(__file__), 'data/output/scene_reconstruction')
    ft.create_directories_if_necessary(save_path)

    # Set up logger
    lt.logger(join(save_path, 'log.txt'), lt.log.INFO)

    return save_path

if __name__ == "__main__":
    save_path = set_up()
    scene_reconstruction(save_path)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I see, it's because we're looking for methods that start with "example_". With that in mind, how do you feel about "example_main" instead of "example_driver"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can refactor to example_main, if you prefer.

Copy link
Collaborator

@bbean23 bbean23 Mar 28, 2024

Choose a reason for hiding this comment

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

I have a slight preference for example_main. Probably not worth another pr just for that, though. 🤷‍♂️

@@ -32,7 +32,7 @@ def setup_class(
output_path='targetcolor',
)
# Setup matplotlib backend
matplotlib.use('TkAgg')
# matplotlib.use('TkAgg')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Feel free to delete this line. I did a similar thing in figure_management.py a while ago:

# matplotlib.use('tkagg') # BGB I don't think we should depend on this
mnger = plt.get_current_fig_manager()
if hasattr(mnger, 'window'):
    if hasattr(mnger.window, 'wm_geometry'):
        mnger.window.wm_geometry(f"+{ul_x}+{ul_y}")
    elif hasattr(mnger.window, 'geometry'):
        curr_dims = mnger.window.geometry().getRect()  # x, y, w, h
        mnger.window.setGeometry(curr_dims[0], curr_dims[1], ul_x, ul_y)

Copy link
Collaborator

@braden6521 braden6521 left a comment

Choose a reason for hiding this comment

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

All looks good to me. Thanks for fixing the example_... prefixes. I'll try to make sure examples are in that format in the future.

@e10harvey e10harvey merged commit 783895a into sandialabs:develop Mar 28, 2024
4 checks passed
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