Hi guys,
Is there any ssh-run alternatives for Linux? We use self-hosted runners for linux.arm64 platform and ssh-run is not option for us because the pipe is not compatible with arm64 platform. scp-deploy is not an option because we have to run several commands on the remote server when we connect. Direct SSH connection seems very difficult to configure.
Regards,
Hi @Ivo,
I just wanted to let you know that the development team added support for linux/arm64 to the ssh-run pipe.
You should be able to use the pipe now on ARM architecture:
If you would like to try it, please ensure that you use the latest version of the pipe.
The variable SSH_KEY in the pipe is also required (instead of keys generated in Bitbucket).
Please feel free to let me know if you have any feedback.
Kind regards,
Theodora
Hi all, below is the config that actually worked for me. Specifying an arm image helped build the container.
image: atlassian/default-image:4-linux-arm64
pipelines:
default:
- step:
runs-on:
- self.hosted
- linux.arm64
name: Deploy to production
deployment: production
script:
- pipe: atlassian/ssh-run:0.8.1
variables:
SSH_USER: ****
SERVER: '*.*.*.*'
If I don't specify the image, build failed with below error:
Images used:
build: atlassian/default-image@sha256:3a09dfec7e36fe99e3910714c5646be6302ccbca204d38539a07f0c2cb5902d4docker: docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-docker-daemon@sha256:6f5a886e1964d15e95187fa0920bce9ae4d53289c10b2518a43dfaea88ddb17d
Runner warnings:
atlassian/default-image:latest: Your kernel does not support memory swappiness capabilities or the cgroup is not mounted. Memory swappiness discarded.
atlassian/default-image:latest: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for sharing that! Indeed, for steps running with a Linux Docker ARM runner, an ARM image needs to be specified as a build container.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ivo ,
I'm afraid that there is no other ssh-run pipe developed by Atlassian for ARM. I have forwarded your request to our pipes team and they will look into developing this and other pipes to work for ARM, but I don't have an ETA to share at the moment.
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.
Hi @Theodora Boudale ,
Thank you very much! I hope they will develop pipes for ARM too.
In the meantime I will try the SSH method which is a little bit confusing.
Regards,
Ivo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Theodora Boudale ,
For now I'm going to use the ssh method with the following script step from the pipeline:
script:
- apt update && apt install -y ssh openssh-client bash
- ssh-keyscan -H $SERVER >> ~/.ssh/known_hosts
- ssh $USER@$SERVER 'ls -lah /home/path/to/project'
The connection seems to work fine and I see the files in the specified project folder. What is wrong is that the user and group for files and folders are incorrect and mixed with my repository variable $USER. Example:
drwxrwxr-x 2 $USER $USER 4.0K Jun 25 12:23 .
drwxrwxr-x 43 $USER $USER 4.0K Jun 12 09:28 ..
-rw-rw-r-- 1 $USER $USER 2.3K Jun 25 12:23 file.php
I assume it's something with the permissions but I'm not able to sort it out.
Any help?
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ivo,
Is this the output that you see in the Pipelines build log?
This is expected behavior if your repository variable $USER is a secured variable. If some text in the Pipelines build log matches the value of a secured variable, then Pipelines masks this value and replaces it with the variable name.
For example, if the value of the repository variable $USER is myuser, and $USER is a secured variable, then all occurences of the text myuser in the build logs will be replaced with $USER.
Can you please confirm if $USER is a secured variable and if its value is the same as the user and group who owns these files on your server?
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.
Hi @Theodora Boudale ,
Sorry, I totally forgot about the secured variables option in the repository variables. Everything seems to work fine now. Thank you!
Regards,
Ivo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to hear, Ivo, thank you for the update. Please feel free to reach out if you need anything else!
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.
Can you Run the SSH-run Pipe (https://bitbucket.org/atlassian/ssh-run/src/master/) on an amd64 Self hosted runner (Works on Docker Runner) and ssh into the Linux ARM Platform you have and run your scripts on there ? You can also setup ARM64 Docker Runner on your ARM64 Platform to run your Builds. https://bitbucket.org/blog/announcing-support-for-linux-arm-runners-in-bitbucket-pipelines
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.