I have parallel steps - each steps use linux shell runners and execute scripts.
The scripts contains action that pulls the latest code and restarting service.
The script was use in all steps, other step is success and other is fail but on fail steps, the build teardown is same on the successful steps:
I'm using the latest version of pipelines-runner as of today:
Hi @ronwaldo_querol,
Welcome to the community.
For your Parallel steps, would you be able to confirm if you're using the same Linux Shell runner?
Also, please be aware of how the Linux Shell runners run your scripts:
Linux Shell Runners use Bash to run pipeline steps on your Linux machine (host device). This allows the runner to execute applications on the host, but does not provide a clean build environment for every step. Any side effects generated by the step (such as, installing any applications, starting a database service, or editing a file outside of the build directory) would potentially affect the next step to be run (including new pipeline runs). To compensate for this, the runner try to empty the build directory empty after each step. It is your responsibility to make sure the scripts you run in each step won’t have a major impact on other steps.
Reference: Set up runners for Linux Shell
Regards,
Mark C
Hi @Mark C - no, each parallel steps use Linux Shell runner but each of them used different workspace runner.
Workspace Runners:
Runner name: my-runner-1
Labels: self.hosted, linux.shell, my-runner-1
Runner name: my-runner-2
Labels: self.hosted, linux.shell, my-runner-2
Where is the build directory located and how we can empty after each step ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ronwaldo_querol
Are those runners running on the same self-hosted machine?
If yes, you can try using only 1 runner for your parallel steps and see how it goes.
The build directory is usually located from where you started the runners in your self-hosted machine.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mark C - no, they running on separate host instance.
So our use case is we have separate repository where we store script related to deployment including the script that run linux shell runner.
We created a linux service to start/stop the linux shell runner.
Everytime there is changes on this repository - the pipeline will access every servers(1 server = 1 step) will try to restart the linux shell runner service.
The service is actually restarting, but the status on the pipeline is failed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ronwaldo_querol,
Please allow me to step in as Mark is out of office at the moment.
You mentioned that you execute some scripts during your builds. If the command in your yml file is for example
- ./somescript.sh
You can adjust it as follows:
- ./somescript.sh || echo $?
If the execution of somescript.sh fails, then the exit code will get printed so we can see if the script returns a non-zero exit code. A Pipelines step will fail if a command returns a non-zero exit code.
You also mentioned that the pipeline will try to restart the linux shell runner service. Are you stopping the Linux Shell runner while the pipeline is running?
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Theodora Boudale - thank you for pointing out that I'm trying to restart the Linux Shell runner while the pipeline is running.
All good. I tweak the script to restart the service after a period of time ensuring the pipeline build is completed before restarting the shell runner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome @ronwaldo_querol, and thank you for the update. It's good to hear that the issue is resolved now!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.