Skip to content

Commit

Permalink
drone.io build definition (#1)
Browse files Browse the repository at this point in the history
* drone.io build definition
  • Loading branch information
dgrechka authored Aug 10, 2022
1 parent 0b70637 commit f4a37bd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
kind: pipeline
type: kubernetes
name: default

steps:
- name: build & test docker image
image: plugins/docker
settings:
repo: lostpetinitiative/calvin_zhirui_feature_extractor
dry_run: true
#target: TESTS # this one fails on drone.io build
target: FINAL
- name: build & push docker image
image: plugins/docker
when:
event:
- tag
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: lostpetinitiative/calvin_zhirui_feature_extractor
target: FINAL
auto_tag: true
force_tag: true
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates

RUN mkdir /app
# downloading pretrained weights from Zenodo
RUN wget https://zenodo.org/record/6663662/files/head_swin_bnneck.zip -O /app/head_swin_bnneck.zip
RUN unzip /app/head_swin_bnneck.zip -d /app/head_swin_bnneck
RUN wget https://zenodo.org/record/6663662/files/head_swin_bnneck.zip -nv -O /app/head_swin_bnneck.zip
RUN unzip /app/head_swin_bnneck.zip model.ckpt cfg.yml -d /app/head_swin_bnneck
RUN rm /app/head_swin_bnneck.zip
# last.ckpt is the same as model.ckpt, so deleting it to save image space
RUN rm /app/head_swin_bnneck/last.ckpt

FROM python:3.9-slim AS FINAL

Expand Down
4 changes: 3 additions & 1 deletion code/test_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def test_process_job(self):

output_job = infer.process_job(model, preproc_transform, job)

assert json.dumps(expected_output) == json.dumps(output_job)
exp_json = json.dumps(expected_output)
actual_json = json.dumps(output_job)
assert exp_json == actual_json, f"Output job does not match expected output {exp_json} {actual_json}"
assert "yolo5_output" not in output_job


Expand Down

0 comments on commit f4a37bd

Please sign in to comment.