Skip to content

Commit

Permalink
Changed the binary path
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelRobidas committed May 6, 2024
1 parent d6eacdb commit bbbc093
Show file tree
Hide file tree
Showing 42 changed files with 340 additions and 287 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.10-slim-bookworm AS build

RUN mkdir -p /binaries/
RUN mkdir -p /calcus/binaries/
COPY scripts /calcus/scripts
COPY bin /binaries/xtb
COPY bin /calcus/binaries/xtb
RUN python /calcus/scripts/extract_xtb.py

RUN apt update && apt install build-essential gcc libxm4 libgl1 libmagic1 -y
Expand All @@ -16,7 +16,7 @@ RUN pip install -r /calcus/requirements.txt

FROM python:3.10-slim-bookworm AS calcus_user

COPY --from=0 /binaries/ /binaries/
COPY --from=0 /calcus/binaries/ /calcus/binaries/

ARG CALCUS_VERSION_HASH
ENV CALCUS_VERSION_HASH=${CALCUS_VERSION_HASH}
Expand All @@ -26,14 +26,14 @@ ENV CALCUS_KEY_HOME "/calcus/keys"
ENV CALCUS_TEST_SCR_HOME "/calcus/scratch/scr"
ENV CALCUS_TEST_KEY_HOME "/calcus/scratch/keys"

ENV EBROOTORCA "/binaries/orca"
ENV GAUSS_EXEDIR "/binaries/g16"
ENV XTB4STDAHOME "/binaries/xtb"
ENV XTBPATH "/binaries/xtb/xtb:$XTB4STDAHOME"
ENV STDAHOME "/binaries/xtb"
ENV EBROOTORCA "/calcus/binaries/orca"
ENV GAUSS_EXEDIR "/calcus/binaries/g16"
ENV XTB4STDAHOME "/calcus/binaries/xtb"
ENV XTBPATH "/calcus/binaries/xtb/xtb:$XTB4STDAHOME"
ENV STDAHOME "/calcus/binaries/xtb"

ENV PATH=$PATH:$XTB4STDAHOME/xtb/bin:$XTB4STDAHOME:$EBROOTORCA:$GAUSS_EXEDIR
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/binaries/orca:/usr/lib/openmpi/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/calcus/binaries/orca:/usr/lib/openmpi/

ENV PYTHONUNBUFFERED 1

Expand Down
2 changes: 0 additions & 2 deletions cloud-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

services:
redis:
image: redis:latest
Expand Down
2 changes: 0 additions & 2 deletions dev-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

services:
redis:
image: redis:latest
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

services:
redis:
image: redis:latest
Expand Down
4 changes: 2 additions & 2 deletions docker/slurm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ RUN yes "clustertest" | passwd slurm

ENV EBROOTORCA "/home/slurm/orca"
ENV GAUSS_EXEDIR "/home/slurm/g16"
ENV XTB4STDAHOME "/binaries/xtb/"
ENV XTB4STDAHOME "/calcus/binaries/xtb/"
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/home/slurm/orca"

ENV PATH=$PATH:"/home/slurm/xtb:/home/slurm/g16:/home/slurm/orca:/home/slurm/other:/home/slurm/openmpi"
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/binaries/orca:/usr/lib/openmpi/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/calcus/binaries/orca:/usr/lib/openmpi/

ADD slurm.conf /etc/slurm-llnl/
ADD cgroup.conf /etc/slurm-llnl/
Expand Down
4 changes: 2 additions & 2 deletions frontend/calculation_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from django.core.management import call_command

from frontend import tasks
from .libxyz import *
from .models import *
from .libxyz import get_angle, parse_xyz_from_text
from .models import np
from .gen_calc import gen_calc
from .tasks import run_calc
from .calcusliveserver import SCR_DIR
Expand Down
18 changes: 13 additions & 5 deletions frontend/calcusliveserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,18 @@

from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.management import call_command
from django.contrib.auth.models import User

from .models import *
from .environment_variables import *
from .models import (
Calculation,
CalculationOrder,
Ensemble,
Molecule,
Project,
ResearchGroup,
settings,
User,
)
from .environment_variables import CALCUS_KEY_HOME, CALCUS_SCR_HOME

tests_dir = os.path.join("/".join(__file__.split("/")[:-1]), "tests/")
dir_path = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -1773,7 +1781,7 @@ def get_name_presets(self):

def select_preset(self, name):
self.wait_for_ajax()
element = WebDriverWait(self.driver, 2).until(
WebDriverWait(self.driver, 2).until(
EC.presence_of_element_located(
(By.XPATH, f"//*[@id='presets']/option[text()='{name}']")
)
Expand Down Expand Up @@ -2173,7 +2181,7 @@ def subscribe(self, plan, email, card_number, length="month"):
if length == "year":
switch = WebDriverWait(self.driver, 5).until(
EC.presence_of_element_located(
(By.CSS_SELECTOR, f"[for=sub_length_switch]")
(By.CSS_SELECTOR, "[for=sub_length_switch]")
)
)
switch.click()
Expand Down
2 changes: 1 addition & 1 deletion frontend/cloud_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.conf import settings

from .environment_variables import *
from .environment_variables import IS_TEST
from .helpers import job_triage

if settings.IS_CLOUD:
Expand Down
4 changes: 2 additions & 2 deletions frontend/cluster_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class ConnectionCodes:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "calcus.settings")
django.setup()

from frontend.models import *
from frontend.environment_variables import *
from frontend.models import Calculation, ClusterAccess, ErrorCodes
from frontend.environment_variables import CALCUS_KEY_HOME, CALCUS_SCR_HOME
from frontend import tasks


Expand Down
2 changes: 1 addition & 1 deletion frontend/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def default(request):
try:
d["SUBSCRIPTION_DATA"] = constants.SUBSCRIPTION_DATA[version]
except (NameError, AttributeError):
logger.error(f"Could not get subscription data")
logger.error("Could not get subscription data")

return d
2 changes: 1 addition & 1 deletion frontend/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

from django.http import HttpResponse, HttpResponseRedirect
from django.http import HttpResponseRedirect


def superuser_required(func):
Expand Down
2 changes: 1 addition & 1 deletion frontend/environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@

MEM = int(PAL) * STACKSIZE
EBROOTORCA = os.environ.get("EBROOTORCA", "")
MULTIWFN_DIR = os.environ.get("MULTIWFN_DIR", "/binaries/xtb/")
MULTIWFN_DIR = os.environ.get("MULTIWFN_DIR", "/calcus/binaries/xtb/")
16 changes: 8 additions & 8 deletions frontend/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def save(self, commit=True):

if commit:
user.save()
r = ResourceAllocation.objects.create(
ResourceAllocation.objects.create(
code=get_random_string(),
redeemer=user,
allocation_seconds=settings.FREE_DEFAULT_COMP_SECONDS,
note=ResourceAllocation.NEW_ACCOUNT,
)
proj = Project.objects.create(name="My Main Project", author=user)
Project.objects.create(name="My Main Project", author=user)

return user

Expand Down Expand Up @@ -119,17 +119,17 @@ def validate_access_code(self):
classes = ClassGroup.objects.filter(access_code=code)

if classes.count() == 0:
raise ValidationError(f"No group found with such access code")
raise ValidationError("No group found with such access code")
elif classes.count() > 1:
logger.error(f"Multiple groups found with access code {code}!")
raise ValidationError(f"Internal error")
raise ValidationError("Internal error")
elif classes.count() == 1:
self.student_class = classes.first()
else:
logger.error(
f"Unexpected number of groups found with access code {code}: {classes.count()}!"
)
raise ValidationError(f"Internal error")
raise ValidationError("Internal error")

def save(self, commit=True):
user = super().save(commit=False)
Expand Down Expand Up @@ -188,13 +188,13 @@ def save(self, commit=True):

if commit:
user.save()
r = ResourceAllocation.objects.create(
ResourceAllocation.objects.create(
code=get_random_string(),
redeemer=user,
allocation_seconds=settings.TRIAL_DEFAULT_COMP_SECONDS,
note=ResourceAllocation.TRIAL,
)
proj = Project.objects.create(name="My Main Project", author=user)
Project.objects.create(name="My Main Project", author=user)

return user

Expand Down Expand Up @@ -239,7 +239,7 @@ def save(self, commit=True):

if commit:
user.save()
r = ResourceAllocation.objects.create(
ResourceAllocation.objects.create(
code=get_random_string(),
redeemer=user,
allocation_seconds=(
Expand Down
12 changes: 11 additions & 1 deletion frontend/gen_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

from .models import *
from .models import (
BasicStep,
Calculation,
CalculationOrder,
Ensemble,
Molecule,
Parameters,
Project,
Structure,
os,
)
from .tasks import generate_xyz_structure

TESTS_DIR = os.path.join("/".join(__file__.split("/")[:-1]), "tests/")
Expand Down
2 changes: 1 addition & 1 deletion frontend/gen_data_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

from constants import *
from .constants import SOFTWARE_BASIS_SETS, SOFTWARE_METHODS

TABLE_TEMPLATE = """
<table class="table">
Expand Down
2 changes: 1 addition & 1 deletion frontend/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from django.conf import settings
from xkcdpass import xkcd_password as xp

from .constants import *
from .constants import ATOMIC_NUMBER, ATOMIC_SYMBOL, BOHR_VAL

full_alphabet = string.ascii_letters + string.digits

Expand Down
14 changes: 9 additions & 5 deletions frontend/libxyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
"""

import json
import numpy as np
import periodictable
import copy
from .constants import *

from hashlib import md5
import numpy as np
from numpy.linalg import expm, norm
from numpy import cross, eye


from .constants import ATOMIC_NUMBER


# Structure of xyz:
# [<EL>, [x, y, z]]
Expand Down Expand Up @@ -375,15 +379,15 @@ def create_derivative(base_xyz, sub_xyz):

anchor = [i for i in range(len(sub_xyz)) if sub_xyz[i][0] == "He"]
if len(anchor) != 1:
print("Invalid substituent: {}".format(sub))
print("Invalid substituent")
return

anchor = anchor[0]

conn = get_neighbors_lists(sub_xyz, He_radius=1.4)
anchor_neigh = conn[anchor]
if len(anchor_neigh) != 1:
print("Could not find proper substitution bond: {}".format(sub))
print("Could not find proper substitution bond")
return
sub_neigh = anchor_neigh[0]

Expand Down
5 changes: 1 addition & 4 deletions frontend/management/commands/add_resources.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import os
from django.core.management.base import BaseCommand

from frontend.models import *
from frontend.environment_variables import *
from frontend.tasks import run_calc
from frontend.models import ResourceAllocation, User
from frontend.helpers import get_random_string


Expand Down
2 changes: 1 addition & 1 deletion frontend/management/commands/check_su.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""

from django.core.management.base import BaseCommand
from frontend.models import *
from frontend.models import User, os

su_email = os.environ.get("CALCUS_SU_EMAIL", "")

Expand Down
10 changes: 9 additions & 1 deletion frontend/management/commands/init_static_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@
filepath = pathlib.Path(__file__).parent.resolve()

showcase_dir = os.path.join(filepath.parent.parent, "showcases")
from frontend.models import *
from frontend.models import (
BasicStep,
Example,
Parameters,
Recipe,
ShowcaseEnsemble,
ShowcaseProperty,
Structure,
)
from frontend.libxyz import format_xyz, parse_multixyz_from_file

try:
Expand Down
6 changes: 2 additions & 4 deletions frontend/management/commands/refresh_cached_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

import glob
import os
from django.core.management.base import BaseCommand
from frontend.models import *
from frontend.models import Project, Profile


class Command(BaseCommand):
Expand Down Expand Up @@ -62,7 +60,7 @@ def handle(self, *args, **options):
running += 1
else:
completed += 1
if o.ensemble != None:
if o.ensemble is not None:
mol = o.ensemble.parent_molecule
if mol is not None:
dnum[mol.id] += o.calculation_set.count()
Expand Down
5 changes: 1 addition & 4 deletions frontend/management/commands/reschedule_calc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import glob
import os
from django.core.management.base import BaseCommand

from frontend.models import *
from frontend.environment_variables import *
from frontend.models import Calculation
from frontend.cloud_job import submit_cloud_job


Expand Down
3 changes: 1 addition & 2 deletions frontend/management/commands/run_calc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
from django.core.management.base import BaseCommand

from frontend.models import *
from frontend.environment_variables import *
from frontend.models import Calculation
from frontend.tasks import run_calc


Expand Down
3 changes: 1 addition & 2 deletions frontend/management/commands/wipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

import glob
import os
from django.core.management.base import BaseCommand
from frontend.models import *
from frontend.models import Calculation, Molecule, Project

try:
os.environ["CALCUS_TEST"]
Expand Down
Loading

0 comments on commit bbbc093

Please sign in to comment.