Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions utility_scripts/deploy/deploy_mx_bluesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,18 @@ def _get_permission_groups(beamline: str, dev_mode: bool = False) -> list:
return beamline_groups


def _create_environment_from_control_machine(
def _create_environment(
mx_repo: Deployment,
path_to_create_venv: str,
path_to_dls_dev_env: str,
beamline: str = "i03",
):
try:
user = os.environ["USER"]
except KeyError:
user = input(
"""Couldn't find username from the environment. Enter FedID in order \
to SSH to control machine:"""
)
cmd = f"ssh {user}@{beamline}-control python3 {path_to_create_venv} {path_to_dls_dev_env} {mx_repo.deploy_location}"
cmd = (
f"python3 {path_to_create_venv} {path_to_dls_dev_env} {mx_repo.deploy_location}"
)

process = None
try:
# Call python script on i03-control to create the environment
# Call python script to create the environment
process = subprocess.Popen(cmd, shell=True, text=True, bufsize=1)
process.communicate()
if process.returncode != 0:
Expand Down Expand Up @@ -227,11 +221,8 @@ def main(beamline: str, options: Options):
"utility_scripts/deploy/create_venv.py",
)

# SSH into control machine if not in dev mode
if options.use_control_machine and release_area != DEV_DEPLOY_LOCATION:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: i think we can remove the use_control_machine too

_create_environment_from_control_machine(
mx_repo, path_to_create_venv, path_to_dls_dev_env, beamline
)
_create_environment(mx_repo, path_to_create_venv, path_to_dls_dev_env)
else:
setup_venv(path_to_dls_dev_env, mx_repo.deploy_location)

Expand Down
Loading