Skip to content

Comments

Changed default StreamFlow workdir#876

Draft
LanderOtto wants to merge 1 commit intomasterfrom
fix/default-workdir
Draft

Changed default StreamFlow workdir#876
LanderOtto wants to merge 1 commit intomasterfrom
fix/default-workdir

Conversation

@LanderOtto
Copy link
Collaborator

This commit updates the default StreamFlow workdir. It now creates a user-specific directory containing the StreamFlow folder, which helps avoid permission issues when multiple users share a node.

@codecov
Copy link

codecov bot commented Nov 28, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1818 1 1817 8
View the top 1 failed test(s) by shortest run time
tests/test_translator.py::test_workdir_inheritance
Stack Traces | 0.031s run time
@pytest.mark.asyncio
    async def test_workdir_inheritance() -> None:
        """Test the workdir inheritance of deployments, wrapped deployments and targets"""
        streamflow_config = _get_streamflow_config()
        streamflow_config["workflows"]["test"].setdefault("bindings", []).append(
            {
                "step": "/compute_1",
                "target": [
                    {"deployment": "wrapper_1"},
                    {
                        "deployment": "wrapper_2",
                        "workdir": ".../other/remote/workdir_2",
                    },
                    {"deployment": "wrapper_3"},
                    {"deployment": "wrapper_4"},
                ],
            },
        )
        streamflow_config.setdefault("deployments", {})
        streamflow_config["deployments"] |= {
            "awesome": {
                "type": "docker",
                "config": {"image": "busybox"},
            },
            "handsome": {
                "type": "docker",
                "config": {"image": "busybox"},
                "workdir": "/remote/workdir",
            },
            "wrapper_1": {
                "type": "docker",
                "config": {"image": "busybox"},
                "wraps": {"deployment": "handsome", "service": "boost"},
            },
            "wrapper_2": {
                "type": "docker",
                "config": {"image": "busybox"},
                "wraps": {"deployment": "handsome", "service": "boost"},
                "workdir": "/myremote/workdir",
            },
            "wrapper_3": {
                "type": "docker",
                "config": {"image": "busybox"},
                "wraps": "wrapper_1",
            },
            "wrapper_4": {
                "type": "docker",
                "config": {"image": "busybox"},
                "wraps": "awesome",
            },
        }
    
        workflow_config = _get_workflow_config(streamflow_config)
        workdir_deployment_1 = workflow_config.deployments["handsome"]["workdir"]
        binding_config = get_binding_config("/compute_1", "step", workflow_config)
    
        # The `wrapper_1` deployment does NOT have a `workdir` and wraps the `handsome` deployment
        # Inherit `workdir` of the wrapped deployment
        assert binding_config.targets[0].deployment.name == "wrapper_1"
        assert binding_config.targets[0].deployment.workdir == workdir_deployment_1
        assert binding_config.targets[0].workdir == workdir_deployment_1
    
        # The `wrapper_2` deployment has a `workdir` and wraps the `handsome` deployment
        # Get `workdir` of the `wrapper_2` deployment
        assert binding_config.targets[1].deployment.name == "wrapper_2"
        assert (
            binding_config.targets[1].deployment.workdir
            == workflow_config.deployments["wrapper_2"]["workdir"]
        )
        # The step target can define a different workdir
        compute_1_target = workflow_config.get(PurePosixPath("/compute_1"), "step")
        assert (
            binding_config.targets[1].workdir == compute_1_target["targets"][1]["workdir"]
        )
    
        # The `wrapper_3` deployment does NOT have a `workdir` and wraps the `wrapper_1` deployment
        # Get `workdir` of the `handsome` deployment
        assert binding_config.targets[2].deployment.name == "wrapper_3"
        assert binding_config.targets[2].deployment.workdir == workdir_deployment_1
        assert binding_config.targets[2].workdir == workdir_deployment_1
    
        # The `wrapper_4` deployment does NOT have a `workdir` and wraps the `awesome` deployment
        # Get default `workdir` because `handsome` deployment does NOT have a `workdir` either
        assert binding_config.targets[3].deployment.name == "wrapper_4"
        assert binding_config.targets[3].deployment.workdir is None
>       assert binding_config.targets[3].workdir == (
            os.path.join(os.path.realpath(tempfile.gettempdir()), "streamflow")
            if binding_config.targets[3].deployment == "local"
            else posixpath.join("/tmp", "streamflow")
        )
E       AssertionError: assert '....../tmp/runner/streamflow' == '/tmp/streamflow'
E         
E         - /tmp/streamflow
E         + ....../tmp/runner/streamflow
E         ?     +++++++

tests/test_translator.py:510: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

…user-specific directory containing the StreamFlow folder, which helps avoid permission issues when multiple users share a node.
@GlassOfWhiskey
Copy link
Member

This is a breaking change.
We have to wait at least v0.3.0 to do this kind of updates.

@GlassOfWhiskey GlassOfWhiskey force-pushed the master branch 7 times, most recently from b21f362 to e7820f1 Compare January 12, 2026 08:25
@GlassOfWhiskey GlassOfWhiskey force-pushed the master branch 4 times, most recently from 8c05dac to 4a6edc9 Compare January 24, 2026 13:16
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.

2 participants