Skip to content

Commit

Permalink
Using version strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jakep-allenai committed Nov 13, 2024
1 parent 9610eac commit 6c9c785
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pdelfin/beakerpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from pdelfin.prompts.anchor import get_anchor_text
from pdelfin.check import check_poppler_version
from pdelfin.metrics import MetricsKeeper, WorkerTracker
from pdelfin.version import VERSION

# Initialize logger
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -537,7 +538,7 @@ def submit_beaker_job(args):
b = Beaker.from_env(default_workspace=args.beaker_workspace)
account = b.account.whoami()
owner = account.name
beaker_image = "jakep/pdelfin-inference"
beaker_image = f"jakep/pdelfin-inference-{VERSION}"

task_name = f"pdelfin-{os.path.basename(args.workspace.rstrip('/'))}"
priority = "normal"
Expand Down Expand Up @@ -622,7 +623,7 @@ async def main():

if "AWS_CREDENTIALS_FILE" in os.environ:
cred_path = os.path.join(os.path.expanduser('~'), '.aws', 'credentials')
os.path.makedirs(os.path.dirname(cred_path), exist_ok=True)
os.makedirs(os.path.dirname(cred_path), exist_ok=True)
with open(cred_path, "w") as f:
f.write(os.environ.get("AWS_CREDENTIALS_FILE"))

Expand Down
2 changes: 1 addition & 1 deletion pdelfin/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
_MINOR = "1"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "0"
_PATCH = "1"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""
Expand Down
6 changes: 4 additions & 2 deletions scripts/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

docker build --platform linux/amd64 -f ./scripts/beaker/Dockerfile-inference -t pdelfin-inference .
VERSION=$(python -c 'import pdelfin.version; print(pdelfin.version.VERSION)')
echo "$VERSION"

beaker image create --workspace ai2/oe-data-pdf --name pdelfin-inference pdelfin-inference
docker build --platform linux/amd64 -f ./scripts/beaker/Dockerfile-inference -t pdelfin-inference-$VERSION .
beaker image create --workspace ai2/oe-data-pdf --name pdelfin-inference-$VERSION pdelfin-inference-$VERSION

0 comments on commit 6c9c785

Please sign in to comment.