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 multiple directories to deploy OOD extensions/customizations #3991

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

Conversation

abujeda
Copy link
Contributor

@abujeda abujeda commented Dec 5, 2024

Experimental feature to add support for a folder based OOD extensions structure.
The idea being that administrators can deploy OOD extensions by copying a folder to the new plugins directory.

More infor about the idea in #3916

To test:
Create the plugins folder: /var/www/ood/apps/plugins
Download the attached zip file. It contains a folder with an OOD extension.
Add the folder, session_metrics, into the plugins directory.

/var/www/ood/apps/plugins
│── session_metrics
│    ├── initializers
│    ├── lib
│    └── views

The attached zip file is an OOD extension to add Job metrics to the session card.
It requires a Slurm job scheduler to work.
Screenshot 2024-11-13 at 14 05 46

session_metrics.zip

Fixes #3916

:novnc_default_quality => '2'
:novnc_default_compression => '6',
:novnc_default_quality => '2',
:plugins_directory => '/var/www/ood/apps/plugins'
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be /etc/ood/config/plugins. Stuff in /var/www/ood will be overwritten on updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines +56 to +58
config.paths["config/initializers"] << installed_plugin.join("initializers").to_s
config.autoload_paths << installed_plugin.join("lib").to_s
config.paths["app/views"].unshift installed_plugin.join("views").to_s
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should likely have additional checks here for root owned files in production. I just want to be extra doubly sure that what we load in production is indeed given by an administrator.

        init_dir = installed_plugin.join("initializers")
        safe_load = init_dir.children.all? { |f| File.stat(f.to_s).uid.zero? }
        config.paths["config/initializers"] << init_dir if safe_load

@treydock any additional thoughts here on loading trusted files?

Copy link
Contributor Author

@abujeda abujeda Dec 5, 2024

Choose a reason for hiding this comment

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

I understand the need to make sure that the configuration is given by an admin, but why is this different from the ones we use for load_external_config?, ::Configuration.config_root (/etc/ood/config/apps/dashboard)?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should patch those too, we just haven't.

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 made a change to verify that the plugin folders are owned by root when in production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OOD Customizations Deployment - Individual folder support
3 participants