infrared icon indicating copy to clipboard operation
infrared copied to clipboard

Workspace should be by environment variable

Open talkammer opened this issue 7 years ago • 3 comments

One of the great features of infrared is the workspace usage. However, when wanting to run several runs in parallel, it cannot be done since each session you open in the terminal still "sees" the workspace in use.

Terminal window 1: $ ir workspace list +---------+--------+ | Name | Active | +---------+--------+ | testing | * | +---------+--------+

Terminal window 2: $ ir workspace checkout testing2 WARNING Deprecated: checkout will not be creating workspace unless -c or --create is also specified. Workspace 'testing2' added Now using workspace: 'testing2'

$ ir workspace list +----------+--------+ | Name | Active | +----------+--------+ | testing | | +----------+--------+ | testing2 | * | +----------+--------+

Terminal window 1: $ ir workspace list +----------+--------+ | Name | Active | +----------+--------+ | testing | | +----------+--------+ | testing2 | * | +----------+--------+

Thus running provisioning in parallel in not possible (for example)

talkammer avatar Mar 04 '18 15:03 talkammer

This is because the workspace is evaluated through a file located in ".workspaces/.active" instead of keeping the active workspace in an environment variable.

talkammer avatar Mar 04 '18 15:03 talkammer

Hi Tal,

This behavior is by design. The 'workspace create' command shouldn't automatically check out the newly created workspace, and this will be changed in the future (as you can understand from the warning message) For now, I can suggest creating workspaces and setting the 'IR_WORKSPACE' env var in each session before executing InfraRed commands.

Thanks, Ariel

aopincar avatar Mar 04 '18 16:03 aopincar

@talkammer You nailed it well, yep the use of symlink does not play well with parallel use. I am also opting for using environment variables.

I think that IR_WORKSPACE is already supported.

I don't want to upset anyone, but can we now ditch the active feature? ;)

ssbarnea avatar Apr 30 '18 19:04 ssbarnea