Skip to content

Conversation

Copy link

Copilot AI commented Oct 24, 2025

Summary

This PR adds support for configuring global singularity command-line options (like --silent, --quiet) directly in the plugstack.conf configuration file via a new global= option. This provides administrators with an alternative to using the SLURM_SINGULARITY_GLOBAL environment variable.

Closes #6

Changes

Commit 1: Remove build artifacts and update .gitignore

  • Add entries for _codeql_build_dir/ and _codeql_detected_source_root to prevent build artifacts from being committed

Commit 2: Add global= option support for plugstack.conf configuration

  • main.cpp: Added s_singularity_global static variable, parsing logic for global= parameter, and automatic setting of SLURM_SINGULARITY_GLOBAL environment variable
  • CMakeLists.txt: Added PLUGIN_GLOBAL_ARG CMake cache variable for build-time configuration
  • singularity-exec.conf.in: Updated template to include global=@PLUGIN_GLOBAL_ARG@
  • README.md: Added global= option to configuration options table and -DPLUGIN_GLOBAL_ARG to CMake options table

Commit 3: Update README example to include global= option

  • Updated example configuration to include the new global= parameter

Usage

Administrators can now configure global options in three ways:

1. In plugstack.conf:

required /usr/lib64/slurm/singularity-exec.so \
  default= \
  script=/usr/libexec/slurm-singularity-wrapper.sh \
  bind=/etc/slurm,/var/spool/slurm \
  global=--silent \
  args=""

2. Via CMake during build:

cmake -S . -B build -DPLUGIN_GLOBAL_ARG="--silent --quiet"

3. Via environment variable (existing, still supported):

SLURM_SINGULARITY_GLOBAL=--silent srun --singularity-container=/tmp/container.sif ...

Testing

  • All existing tests pass (100% success rate)
  • Verified plugin compiles with new changes
  • Tested configuration generation with empty, single, and multiple global options
  • Security scan completed with no vulnerabilities

Backward Compatibility

This change is fully backward compatible. The global= parameter is optional and defaults to empty. Existing configurations continue to work without modification, and the SLURM_SINGULARITY_GLOBAL environment variable continues to function as before.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support configuring global command line options like --silent</issue_title>
<issue_description>ref: https://git.gsi.de/SDEGroup/condef/-/issues/44</issue_description>

Comments on the Issue (you are @copilot in this section)

@dennisklein @mtds It is already supported via environment variable `SLURM_SINGULARITY_GLOBAL=--silent`, see https://github.com/GSI-HPC/slurm-singularity-exec?tab=readme-ov-file#usage

However, we should also add the analog plugstack.conf option.</comment_new>

Fixes #6


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Support configuring global command line options for silent mode Add global= option for plugstack.conf to configure singularity global options Oct 24, 2025
Copilot AI requested a review from dennisklein October 24, 2025 12:06
Copilot finished work on behalf of dennisklein October 24, 2025 12:06
Copy link
Member

@dennisklein dennisklein left a comment

Choose a reason for hiding this comment

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

Remove the first empty commit "Initial plan" entirely.

@dennisklein
Copy link
Member

@copilot Please continue working on this PR.

Copy link
Author

Copilot AI commented Oct 24, 2025

Remove the first empty commit "Initial plan" entirely.

I've attempted to reorganize the commits to remove the "Initial plan" commit, but I'm unable to force-push due to tooling constraints. The commit has been removed locally, but the remote still contains the old history. Manual force-push will be needed to update the PR with the cleaned-up history.

@copilot Please continue working on this PR.

I've completed the code reorganization locally to address all the review feedback:

✅ Removed "Initial plan" empty commit
✅ Removed _codeql_build_dir files
✅ Reordered commits with .gitignore first

The final local commit structure is:

  1. d4194de - Update .gitignore to exclude build artifacts
  2. f0fc754 - Add global= option support for plugstack.conf configuration
  3. 8107e66 - Update README example to include global= option

However, due to tooling limitations, I'm unable to force-push these changes to the remote. The automated push tool tries to rebase and drops the commits because it detects the patch contents are already upstream. Manual force-push will be needed to replace the remote history with the cleaned-up commits.

All functionality is implemented and tested successfully (100% tests passing).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from dennisklein October 24, 2025 13:05
Copilot finished work on behalf of dennisklein October 24, 2025 13:05
@dennisklein
Copy link
Member

However, due to tooling limitations, I'm unable to force-push these changes to the remote. The automated push tool tries to rebase and drops the commits because it detects the patch contents are already upstream. Manual force-push will be needed to replace the remote history with the cleaned-up commits.

@copilot Give me instructions of what I should execute manually (I have git and gh tools available, if of any help).

Copy link
Author

Copilot AI commented Oct 24, 2025

However, due to tooling limitations, I'm unable to force-push these changes to the remote. The automated push tool tries to rebase and drops the commits because it detects the patch contents are alr...

Here are the manual steps to clean up the commit history:

# 1. Fetch the latest changes
git fetch origin copilot/support-global-cli-options

# 2. Create a new clean branch from the base commit
git checkout -b copilot/support-global-cli-options-clean 6bf5c88

# 3. Apply only the .gitignore changes first
git show 5c994fb:.gitignore > .gitignore
git add .gitignore
git commit -m "Update .gitignore to exclude build artifacts

Add entries for _codeql_build_dir/ and _codeql_detected_source_root to prevent
build artifacts from being committed to the repository.

Co-authored-by: dennisklein <[email protected]>"

# 4. Apply the main implementation (without _codeql files)
git show 416c048:CMakeLists.txt > CMakeLists.txt
git show 416c048:main.cpp > main.cpp
git show 416c048:singularity-exec.conf.in > singularity-exec.conf.in
git show 416c048:README.md > README.md
git add CMakeLists.txt main.cpp singularity-exec.conf.in README.md
git commit -m "Add global= option support for plugstack.conf configuration

Add support for configuring global singularity command-line options
(like --silent, --quiet) directly in the plugstack.conf configuration
file via a new global= option.

- Add s_singularity_global static variable to store the global option value
- Add parsing logic in init() for the global= parameter
- Set SLURM_SINGULARITY_GLOBAL environment variable in start_container()
- Add PLUGIN_GLOBAL_ARG CMake cache variable for build-time configuration
- Update singularity-exec.conf.in template to include global= parameter
- Add global= option to configuration options table in README
- Add -DPLUGIN_GLOBAL_ARG to CMake options table in README

Co-authored-by: dennisklein <[email protected]>"

# 5. Apply the README example update
git show a5fbf8e:README.md > README.md
git add README.md
git commit -m "Update README example to include global= option

Update example configuration in README to include the new global= parameter.

Co-authored-by: dennisklein <[email protected]>"

# 6. Force push to replace the branch
git push -f origin copilot/support-global-cli-options-clean:copilot/support-global-cli-options

# 7. Update your local branch
git branch -D copilot/support-global-cli-options
git checkout -b copilot/support-global-cli-options origin/copilot/support-global-cli-options

This will create a clean 3-commit history without the "Initial plan", "Temporary commit" commits, and without any _codeql_build_dir files.

Copilot finished work on behalf of dennisklein October 24, 2025 13:49
@dennisklein dennisklein force-pushed the copilot/support-global-cli-options branch from 466112b to 8b30627 Compare October 24, 2025 13:52
Copy link
Member

@dennisklein dennisklein left a comment

Choose a reason for hiding this comment

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

@copilot Looks good to me now. Let's wait for PR #8 to be merged, then we continue here, rebase onto it, and add test coverage for the changes here.

Copilot AI requested a review from dennisklein October 24, 2025 14:11
Copilot finished work on behalf of dennisklein October 24, 2025 14:11
Add entries for _codeql_build_dir/ and _codeql_detected_source_root
to prevent CodeQL build artifacts from being committed.
Add support for configuring global singularity command-line options
through the plugstack.conf configuration file.

- Add s_singularity_global static variable to store the global option
- Parse global= parameter in init() function
- Set SLURM_SINGULARITY_GLOBAL environment variable in start_container()

This allows administrators to configure global options like --silent
or --quiet directly in the configuration file as an alternative to
using the SLURM_SINGULARITY_GLOBAL environment variable.

Closes #6
Add PLUGIN_GLOBAL_ARG CMake cache variable to allow setting the global
option at build time. Update the singularity-exec.conf.in template to
include the global= parameter with the configured value.

This provides build-time configuration flexibility for administrators.
Add documentation for the new global= option in both the configuration
options table and the CMake options section. Update the example
configuration to demonstrate usage.
@dennisklein dennisklein force-pushed the copilot/support-global-cli-options branch from 8b30627 to 4b694d0 Compare November 3, 2025 18:22
@dennisklein dennisklein marked this pull request as ready for review November 3, 2025 18:23
Verify that the global= parameter is read from config and the
SLURM_SINGULARITY_GLOBAL environment variable is set correctly.

The test job explicitly checks the environment variable and prints
its value, which is then validated against the configuration.
@dennisklein dennisklein force-pushed the copilot/support-global-cli-options branch from 4b694d0 to 62d1653 Compare November 4, 2025 15:40
@dennisklein dennisklein merged commit 1697703 into main Nov 4, 2025
3 checks passed
@dennisklein dennisklein deleted the copilot/support-global-cli-options branch November 4, 2025 15:52
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.

Support configuring global command line options like --silent

2 participants