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

Engine: Fix bug in upload calculation for PortableCode with SSH #6519

Merged

Commits on Jul 4, 2024

  1. Engine: Fix bug in upload calculation for PortableCode with SSH

    When a `CalcJob` would be run with a `PortableCode` using a computer
    configured with the `core.ssh` transport plugin, the upload task would
    except. The `aiida.engine.daemon.execmanager.upload_calculation` method
    is passing `pathlib.Path` objects to the transport interface which is
    not supported. By chance this does not raise an exception when using the
    `LocalTransport`, but the `SshTransport` passes these values to the
    paramiko library which does choke on anything but strings.
    
    The use of a `PortableCode` was tested for in the unit test
    `tests/engine/processes/calcjobs/test_calc_job.py:test_portable_code`
    but this would only use a local transport and thus the bug would not
    appear. Parametrizing it to also use the `SshTransport` wouldn't help
    since the test uses `metadata.dry_run = True`, whose implementation will
    always swap the transport to a local one, still avoiding the bugged
    code pathway.
    
    Instead a test is added that directly calls `upload_calculation` which
    parametrizes over all installed transport plugins and uses a
    `PortableCode`. This confirmed the bug. The `upload_calculation` method
    is updated to ensure casting all `pathlib.Path` objects to `str` before
    passing it to the transport.
    sphuber committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    e738c1c View commit details
    Browse the repository at this point in the history