Skip to content

Commit

Permalink
fix docker lint and potential WSL2 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
satchelbaldwin committed Feb 7, 2024
1 parent ce4492c commit 2e4df50
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion api/processing/providers/esgf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from api.search.provider import AccessURLs
from .. import filters
import xarray
from typing import Any, Dict, List
from typing import Any, Dict
from api.dataset.terarium_hmi import construct_hmi_dataset
from api.dataset.remote import cleanup_potential_artifacts, open_dataset

Expand Down
7 changes: 6 additions & 1 deletion api/search/providers/esgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ def initialize_embeddings(self, force_refresh=False):
else:
print("no embedding cache, generating new", flush=True)
with cache.open(mode="wb") as f:
self.embeddings = self.extract_embedding_strings()
try:
self.embeddings = self.extract_embedding_strings()
except Exception as e:
raise IOError(
f"failed to access OpenAI: is OPENAI_API_KEY set in env?: {e}"
)
pickle.dump(self.embeddings, f)

def search(
Expand Down
31 changes: 12 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,18 @@ services:
- TERARIUM_PASS=${TERARIUM_PASS}
depends_on:
- redis
# not sure why, but rq worker was not taking env vars from environment
# above. wrap in shell call for workaround
# this is not identical to the linted list form due to shell string escapes
entrypoint: "nohup sh -c 'TERARIUM_USER=\"${TERARIUM_USER}\" TERARIUM_PASS=\"${TERARIUM_PASS}\" poetry run rq worker-pool subset preview -n5 -u redis://redis-climate-data:6379'"
# entrypoint: [
# "nohup",
# "sh",
# "-c",
# "TERARIUM_USER=\"${TERARIUM_USER}\"",
# "TERARIUM_PASS=\"${TERARIUM_PASS}\"",
# "poetry",
# "run",
# "rq",
# "worker-pool",
# "subset",
# "preview",
# "-u",
# "redis://redis-climate-data:6379"
# ]
entrypoint: [
"poetry",
"run",
"rq",
"worker-pool",
"subset",
"preview",
"-n5",
"-u",
"redis://redis-climate-data:6379"
]

jupyter:
build:
context: ./
Expand Down

0 comments on commit 2e4df50

Please sign in to comment.