Skip to content

Commit c1346e4

Browse files
authored
Remove unnessary SSH in release script (#1529)
* Remove unnessary SSH in release script * Remove use_control_machine * Remove comment
1 parent 1771e3b commit c1346e4

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

utility_scripts/deploy/deploy_mx_bluesky.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ class Options(NamedTuple):
4545
dev_mode: bool = False
4646
prune_deployments: bool = True
4747

48-
# NOTE For i24 for now will need to set it to false from the command line
49-
use_control_machine: bool = True
50-
5148

5249
class Deployment:
5350
# Set name, setup remote origin, get the latest version"""
@@ -109,24 +106,18 @@ def _get_permission_groups(beamline: str, dev_mode: bool = False) -> list:
109106
return beamline_groups
110107

111108

112-
def _create_environment_from_control_machine(
109+
def _create_environment(
113110
mx_repo: Deployment,
114111
path_to_create_venv: str,
115112
path_to_dls_dev_env: str,
116-
beamline: str = "i03",
117113
):
118-
try:
119-
user = os.environ["USER"]
120-
except KeyError:
121-
user = input(
122-
"""Couldn't find username from the environment. Enter FedID in order \
123-
to SSH to control machine:"""
124-
)
125-
cmd = f"ssh {user}@{beamline}-control python3 {path_to_create_venv} {path_to_dls_dev_env} {mx_repo.deploy_location}"
114+
cmd = (
115+
f"python3 {path_to_create_venv} {path_to_dls_dev_env} {mx_repo.deploy_location}"
116+
)
126117

127118
process = None
128119
try:
129-
# Call python script on i03-control to create the environment
120+
# Call python script to create the environment
130121
process = subprocess.Popen(cmd, shell=True, text=True, bufsize=1)
131122
process.communicate()
132123
if process.returncode != 0:
@@ -227,11 +218,8 @@ def main(beamline: str, options: Options):
227218
"utility_scripts/deploy/create_venv.py",
228219
)
229220

230-
# SSH into control machine if not in dev mode
231-
if options.use_control_machine and release_area != DEV_DEPLOY_LOCATION:
232-
_create_environment_from_control_machine(
233-
mx_repo, path_to_create_venv, path_to_dls_dev_env, beamline
234-
)
221+
if release_area != DEV_DEPLOY_LOCATION:
222+
_create_environment(mx_repo, path_to_create_venv, path_to_dls_dev_env)
235223
else:
236224
setup_venv(path_to_dls_dev_env, mx_repo.deploy_location)
237225

@@ -350,7 +338,6 @@ def _parse_options() -> tuple[str, Options]:
350338
quiet=args.print_release_dir,
351339
dev_mode=args.dev,
352340
prune_deployments=args.prune_deployments,
353-
use_control_machine=args.no_control,
354341
)
355342

356343

0 commit comments

Comments
 (0)