Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Participants

Discussion topics

Item

Notes

Give LW Dockerhub creds

LW needs to make an account at hub.docker.com (ideally using openff gmail)

  • LW – I already have one

JW needs to add LW to https://app.docker.com/admin/orgs/openforcefield/members

  • JW – Invite sent

Run evaluator client and server locally

  • LW – MWE SFEs example (py 3.9, evaluator 0.3.11)

    • View file
      namesfes.py
      View file
      namefreesolv.json
      View file
      nameold-evaluator-sfes.yaml

  • LW – started trying to wrap head around parsl

    • Github link macro
      linkhttps://github.com/lilyminium/openff-evaluator/tree/add-nrp-backend
      extendedfalse

JW attempt:

mamba create -n evaluator openff-evaluator

Running natively on mac failed

Trying to run in docker:

using instructions from here: https://github.com/openforcefield/openff-qcsubmit/issues/264

(emulating 64 with the --platform bit)

docker run -it --platform linux/amd64 mambaorg/micromamba

Then outside container:

Code Block
docker cp test.py <container_hash>:/tmp
docker cp tutorial02.py <container_hash>:/tmp
docker cp ~/oe_license.txt <container_hash>:/tmp
docker cp ~/filtered_data_set.json <container_hash>:/tmp

Then in container:

Code Block
micromamba create -n evaluator -c conda-forge openff-evaluator -c openeye openeye-toolkits

View file
nametutorial02.py

filtered_data_set.json:

View file
namefiltered_data_set.json

Run evaluator w/ worker in separate processRun evaluator in dockerserver in separate process

server.py:

Code Block
from openff.evaluator.backends.dask import DaskLocalCluster
from openff.evaluator.server import EvaluatorServer

with DaskLocalCluster() as calculation_backend:

    evaluator_server = EvaluatorServer(calculation_backend)
    evaluator_server.start()

client.py

Code Block
import pathlib

from openff.evaluator.datasets import PhysicalPropertyDataSet

data_set_path = "filtered_data_set.json"
if not pathlib.Path(data_set_path).exists():
    from openff.evaluator.utils import get_data_filename

    data_set_path = get_data_filename("tutorials/tutorial01/filtered_data_set.json")

data_set = PhysicalPropertyDataSet.from_json(data_set_path)
from openff.evaluator.forcefield import SmirnoffForceFieldSource

force_field_path = "openff-1.0.0.offxml"
force_field_source = SmirnoffForceFieldSource.from_path(force_field_path)
from openff.evaluator.properties import Density, EnthalpyOfVaporization

density_schema = Density.default_simulation_schema(n_molecules=256)
for schema in density_schema.workflow_schema.protocol_schemas:
    # equilibration_simulation is a Protocol                                                                                                                                
    if "simulation" in schema.id:
        schema.inputs[".steps_per_iteration"] = 10
        schema.inputs[".output_frequency"] = 10
    # conditional_group is a group of protocols                                                                                                                             
    if "conditional" in schema.id:
        for protocol_name, protocol in schema.protocol_schemas.items():
            if "simulation" in protocol_name:
                protocol.inputs[".steps_per_iteration"] = 10
                protocol.inputs[".output_frequency"] = 10

from openff.evaluator.client import RequestOptions

# Create an options object which defines how the data set should be estimated.                                                                                              
estimation_options = RequestOptions()
# Specify that we only wish to use molecular simulation to estimate the data set.                                                                                           
estimation_options.calculation_layers = ["SimulationLayer"]

# Add our custom schemas, specifying that the should be used by the 'SimulationLayer'                                                                                       
estimation_options.add_schema("SimulationLayer", "Density", density_schema)
from openff.evaluator.client import EvaluatorClient

evaluator_client = EvaluatorClient()

request, exception = evaluator_client.request_estimate(
    property_set=data_set,
    force_field_source=force_field_source,
    options=estimation_options,
)
assert exception is None

results, exception = request.results(synchronous=True, polling_interval=30)
assert exception is None
print(len(results.queued_properties))

print(len(results.estimated_properties))

print(len(results.unsuccessful_properties))
print(len(results.exceptions))
print(results.estimated_properties.json("estimated_data_set.json", format=True))

Run evaluator client locally and server in docker

docker run -it -p 8000:8000 --platform linux/amd64 mambaorg/micromamba

Getting a real connection on port 8000 (if I change the client port to 8001 I get “connection refused”) but it’s failing at the assert exception is None line with

Code Block
(evaluator) jeffreywagner@JW-MBP$ python client.py
Traceback (most recent call last):
  File "/Users/jeffreywagner/projects/OpenForceField/2024_07_31_evaluator_on_nrp/client.py", line 49, in <module>
    assert exception is None, exception
AssertionError: Traceback (most recent call last):
  File "/Users/jeffreywagner/mambaforge/envs/evaluator/lib/python3.10/site-packages/openff/evaluator/client/client.py", line 811, in _send_calculations_to_server
    length = unpack_int(header)[0]
TypeError: a bytes-like object is required, not 'NoneType'

I get this error whether or not the server is running

  • LW – on port 8000, I get `ConnectionResetError: [Errno 54] Connection reset by peer`. (8001 also gets me “connection refused”)

    • LW – explicitly requesting “localhost” as the server address gets me the NoneType error

  • LW – this is because EvaluatorServer hardcodes where it’s listening from, i.e. “localhost”. This server script works for me if I change it to listen to all IP addresses:

    • View file
      nameserver-hack.py

  • LW – also, I was experimenting with different ways to run so I made a very simple image:

    View file
    nameDockerfile

    • This can be built with docker build --platform linux/amd64 --tag evaluator-openeye-v0 .

    • And run with docker run -it -p 8000:8000 --platform linux/amd64 evaluator-openeye-v0

  • To dos:

    • Figure out if using a “0.0.0.0” address on Evaluator could be unsafe? It allows listening for connections on all interfaces. Does ChatGPT4 know?

    • Is there another way to fix this?

Run evaluator worker on NRP, installing software in base container

Build evaluator worker docker image and deploy on DockerHub

...