kernelci / kernelci-pipeline

Modular pipeline based on the KernelCI API
GNU Lesser General Public License v2.1
8 stars 20 forks source link

tarball - No authentication methods available #296

Open yurinnick opened 1 year ago

yurinnick commented 1 year ago

Tarball service fails to find SSH credentials unless explicitly specified:

kernelci-pipeline-tarball             | 08/01/2023 12:50:16 AM UTC [INFO] Uploading /home/kernelci/data/output/linux-mainline-master-v6.5-rc4-1-g45b7d7534050.tar.gz
kernelci-pipeline-tarball             | 08/01/2023 12:50:16 AM UTC [INFO] Connected (version 2.0, client OpenSSH_8.4p1)
kernelci-pipeline-tarball             | 08/01/2023 12:50:16 AM UTC [ERROR] Traceback (most recent call last):
kernelci-pipeline-tarball             |   File "/home/kernelci/pipeline/base.py", line 69, in run
kernelci-pipeline-tarball             |     status = self._run(context)
kernelci-pipeline-tarball             |   File "/home/kernelci/./pipeline/tarball.py", line 168, in _run
kernelci-pipeline-tarball             |     tarball_url = self._push_tarball(build_config, describe)
kernelci-pipeline-tarball             |   File "/home/kernelci/./pipeline/tarball.py", line 103, in _push_tarball
kernelci-pipeline-tarball             |     tarball_url = self._storage.upload_single((tarball_path, tarball_name))
kernelci-pipeline-tarball             |   File "/usr/local/lib/python3.10/site-packages/kernelci-1.1-py3.10.egg/kernelci/storage/__init__.py", line 57, in upload_single
kernelci-pipeline-tarball             |     self._upload([file_path], dest_path)
kernelci-pipeline-tarball             |   File "/usr/local/lib/python3.10/site-packages/kernelci-1.1-py3.10.egg/kernelci/storage/ssh.py", line 27, in _upload
kernelci-pipeline-tarball             |     ssh.connect(
kernelci-pipeline-tarball             |   File "/usr/local/lib/python3.10/site-packages/paramiko/client.py", line 485, in connect
kernelci-pipeline-tarball             |     self._auth(
kernelci-pipeline-tarball             |   File "/usr/local/lib/python3.10/site-packages/paramiko/client.py", line 819, in _auth
kernelci-pipeline-tarball             |     raise SSHException("No authentication methods available")
kernelci-pipeline-tarball             | paramiko.ssh_exception.SSHException: No authentication methods available

When specified with --storage-cred args, works as expected

  tarball:
    <<: *base-service
    container_name: 'kernelci-pipeline-tarball'
    command:
      - './pipeline/tarball.py'
      - '--settings=${SETTINGS:-/home/kernelci/config/kernelci.toml}'
      - 'run'
+      - '--storage-cred=/home/kernelci/data/ssh/id_rsa_tarball'
gctucker commented 1 year ago

Yes, that's expected. In fact it's typically stored in the TOML settings file so you don't have to pass credentials on the command line.

JenySadadia commented 1 year ago

Yes, that's expected. In fact it's typically stored in the TOML settings file so you don't have to pass credentials on the command line.

@gctucker We need to merge https://github.com/kernelci/kernelci-pipeline/pull/288 to get it working.

yurinnick commented 1 year ago

I have this part in the config, shouldn't it be enough?

["storage:docker-host"]
storage_cred = "/home/kernelci/data/ssh/id_rsa_tarball"
JenySadadia commented 1 year ago

I have this part in the config, shouldn't it be enough?

["storage:docker-host"]
storage_cred = "/home/kernelci/data/ssh/id_rsa_tarball"

Please pull the main branch again. That'd fix the issue.

gctucker commented 1 year ago

@yurinnick See @JenySadadia's response, I just merged the PR with the fix in the sample TOML file.

@yurinnick Are you using a TOML settings file or an old-style .config file?

yurinnick commented 1 year ago

I use toml file from docker-compose

gctucker commented 1 year ago

The section name should be [storage.docker-host] since the move to use regular TOML dotted keys rather than : separators.