Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update api readme #178

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update api readme #178

wants to merge 2 commits into from

Conversation

liviuba
Copy link
Contributor

@liviuba liviuba commented Sep 3, 2024

api/Readme.md Outdated
@@ -40,19 +16,40 @@ curl -H "Content-Type: application/json" \
http://localhost:8080/v2/auth/user/register
```

The response should be just `null` and there should be no errors in the api container.
You should be able to authenticate using the email/password above at http://localhost:8080/docs (Authenticate button)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authorize button, not Authenticate on my screen.

api/Readme.md Outdated
pwd

# the api used for testing runs on the host (not in docker) and is configures with the .env created above
pytest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poetry run pytest

this gives me ERROR - KeyError: 'DB_NAME'

Copy link
Contributor Author

@liviuba liviuba Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this after following the steps in the whole block, including creating bia-integrator/api/.env ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

@liviuba liviuba Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should happen is that if the api virtualenv is started, poetry loads the .env when I switch to the virtualenv. Except vscode switches into the virtualenv for every terminal, but the actual plain terminal doesn't. Tweaked the readme now, does poetry run pytest work?


# the api used for testing runs on the host (not in docker) and is configures with the .env created above
pytest
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below worked fine until
docker build -t api-bia-integrator-api:latest .
Got the following error:

[+] Building 2.1s (10/13) docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.01kB 0.0s
=> [internal] load metadata for docker.io/library/python:3.10.0 1.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/9] FROM docker.io/library/python:3.10.0@sha256:a1fba384d3aa879533a271ab5d73965fbd3385648f38835dacd07e519f1c7c3f 0.0s
=> [internal] load build context 1.0s
=> => transferring context: 628.46kB 1.0s
=> CACHED [2/9] RUN curl -sSL https://install.python-poetry.org | python3 - 0.0s
=> CACHED [3/9] WORKDIR /bia-integrator 0.0s
=> [4/9] ADD api/poetry.lock* api/poetry.lock 0.0s
=> ERROR [5/9] ADD api/pyproject.toml api/pyproject.toml 0.0s
=> ERROR [6/9] ADD bia-shared-datamodels bia-shared-datamodels 0.0s

[5/9] ADD api/pyproject.toml api/pyproject.toml:



[6/9] ADD bia-shared-datamodels bia-shared-datamodels:


Dockerfile:17

15 |
16 | # This needed to be added because it's a poetry dep
17 | >>> ADD bia-shared-datamodels bia-shared-datamodels
18 |
19 | WORKDIR /bia-integrator/api

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 4a7e193a-3bcc-4f93-b2be-9c4f5ccebe46::0hkxb8pimlv2bx4oy73ozdx1h: "/bia-shared-datamodels": not found

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this run in bia-integrator/api? Adding that in the readme now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, I thought that part was still working so left it in but it's not because we switched context root. Fixing now

Copy link
Contributor

@AybukeKY AybukeKY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone through the steps except pushing docker hub image registery and got some errors for some of them.
Also it was a bit unclear for me with the info about VSCode in the middle, to figure out what's needed for what.

@liviuba
Copy link
Contributor Author

liviuba commented Sep 5, 2024

Fixed comments (I think), can you retry the parts that weren't working previously please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants