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

Upgrading Aurora to AiiDA 2.x #26

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
run: |
pip install --upgrade pip
pip install -e .[testing]
reentry scan -r aiida

- name: Run test suite
env:
Expand All @@ -65,7 +64,6 @@ jobs:
run: |
pip install --upgrade pip
pip install -e .[docs]
reentry scan -r aiida
- name: Build docs
run: cd docs && make

Expand All @@ -82,7 +80,6 @@ jobs:
run: |
pip install --upgrade pip
pip install -e .[pre-commit,docs,testing]
reentry scan -r aiida
- name: Run pre-commit
run: |
pre-commit install
Expand Down
2 changes: 1 addition & 1 deletion aiida_aurora/calculations/cycler.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def prepare_for_submission(self, folder):
"""

# if connecting to a Windows PowerShell computer, change the extension of the submit script to '.ps1'
if self.inputs.code.computer.transport_type == "sshtowin":
if self.inputs.code.computer.transport_type == "ssh2win":
submit_script_filename = self.node.get_option("submit_script_filename")
if not submit_script_filename.endswith(".ps1"):
if submit_script_filename.endswith(".sh"):
Expand Down
13 changes: 9 additions & 4 deletions aiida_aurora/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ def _get_submit_script_header(self, job_tmpl):
:param job_tmpl: a ``JobTemplate`` instance with relevant parameters set.
"""
# set the `_shell_cmd` class attribute from the job template
TomatoScheduler._shell_cmd = job_tmpl.shell_type
# FIXME shell_type used to be job_tmpl.shell_type, which was added to
# aiida-core's `JobTemplate` class by Loris. Awaiting resolution.
shell_type = "powershell"
# shell_type = "bash" # uncomment when debugging on Linux
TomatoScheduler._shell_cmd = shell_type
self._logger.debug(f"_get_submit_script_header: _shell_cmd: {self._shell_cmd}")

import string
Expand All @@ -155,14 +159,14 @@ def _get_submit_script_header(self, job_tmpl):
job_title = re.sub(r"[^a-zA-Z0-9_.-]+", "", job_tmpl.job_name)

# prepend a 'j' (for 'job') before the string if the string
# is now empty or does not start with a valid charachter
# is now empty or does not start with a valid character
if not job_title or (job_title[0] not in string.ascii_letters + string.digits):
job_title = f"j{job_title}"

# Truncate to the first 128 characters
# Nothing is done if the string is shorter.
job_title = job_title[:128]
if job_tmpl.shell_type == "powershell":
if shell_type == "powershell":
header = f"$JOB_TITLE='{job_title}'"
else:
header = f"JOB_TITLE='{job_title}'"
Expand Down Expand Up @@ -342,7 +346,8 @@ def _parse_submit_output(self, retval, stdout, stderr):
stdout_dict = yaml.full_load(stdout)
if "jobid" in stdout_dict:
self._logger.debug(f"The submitted jobid is {stdout_dict['jobid']}")
return stdout_dict["jobid"]
# HACK did not need to str-cast prior to aiida 2.x upgrade
return str(stdout_dict["jobid"])

# If I am here, no jobid was found
self.logger.error(f"in _parse_submit_output: unable to find the job id: {stdout}")
Expand Down
11 changes: 0 additions & 11 deletions aiida_aurora/workflows/__init__.py

This file was deleted.

272 changes: 0 additions & 272 deletions aiida_aurora/workflows/stress_test.py

This file was deleted.

Loading
Loading