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

feat: Add support for executing custom user data #14

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

vprashar2929
Copy link
Contributor

@vprashar2929 vprashar2929 commented Sep 17, 2024

This commit introduces the ability to run a custom script prior to installing and starting the runner service. Users can now pass custom script (runs as sudo) to configure their runners with specific requirements before the runner is fully initialized.

A new input parameter custom_script has been added. It accepts a string value representing the custom script. If this parameter is provided, the script will be executed before the runner service starts, allowing for custom configurations or setup tasks to be performed seamlessly.

Address: #13

@vprashar2929 vprashar2929 requested a review from a team as a code owner September 17, 2024 05:44
action.yml Outdated Show resolved Hide resolved
action.yml Outdated
echo "Running custom user data"
echo "${{ inputs.custom_user_data }}" | tee /tmp/custom_user_data.sh
chmod +x /tmp/custom_user_data.sh
sudo /tmp/custom_user_data.sh
Copy link

Choose a reason for hiding this comment

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

sudo changes user to root is that intentional?
E.g. if I want to run pip install --user foobar it will be installed in /root instead of current user.

Copy link
Member

@displague displague Sep 27, 2024

Choose a reason for hiding this comment

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

@sthaha @vprashar2929 userdata/cloud-init is run as the root user. sudo can be removed.

action.yml Outdated Show resolved Hide resolved
action.yml Show resolved Hide resolved
This commit introduces the ability to run a custom script prior to
installing and starting the runner service. Users can now pass custom
script (runs as sudo) to configure their runners with specific requirements before
the runner is fully initialized.

A new input parameter `custom_script` has been added. It accepts a
string value representing the custom script. If this parameter is
provided, the script will be executed before the runner service starts,
allowing for custom configurations or setup tasks to be performed seamlessly.

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
@displague
Copy link
Member

@vprashar2929 Thanks for the quick turn-around.

Could you also update the README.md Inputs and example with the new parameter

Copy link
Member

@displague displague left a comment

Choose a reason for hiding this comment

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

Let's update README.md and remove the sudo

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