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

Add Docker Compose example #109

Merged

Conversation

easybe
Copy link
Collaborator

@easybe easybe commented Aug 30, 2024

This demonstrates how to deploy the service in production using the
Docker image together with NGINX and PostgreSQL.

Run with:

docker compose -f docker/demo/docker-compose.yml up

The service can then be accessed under: https://localhost

Closes #31

This was referenced Aug 30, 2024
@easybe easybe force-pushed the gardena/eb/docker_compose branch from 9f1f7d1 to 36e89cf Compare August 31, 2024 06:55
@easybe easybe changed the title WIP: Docker Compose example WIP: Docker Compose support Aug 31, 2024
@easybe easybe changed the title WIP: Docker Compose support WIP: Docker Compose files Aug 31, 2024
@easybe easybe added this to the v0.3.0 milestone Sep 4, 2024
@easybe easybe force-pushed the gardena/eb/docker_compose branch 2 times, most recently from 56883f3 to ad8f545 Compare September 11, 2024 12:39
@easybe easybe changed the title WIP: Docker Compose files Add Docker Compose example Sep 11, 2024
@easybe easybe requested a review from b-rowan September 11, 2024 12:40
@easybe easybe marked this pull request as ready for review September 11, 2024 12:40
@easybe easybe force-pushed the gardena/eb/docker_compose branch 3 times, most recently from b2e40d6 to 09f493f Compare September 11, 2024 12:48
Copy link
Collaborator

@b-rowan b-rowan left a comment

Choose a reason for hiding this comment

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

Looks good to me, will do some testing.

Only concern is the hard coding of variables (like GOOSEBIT_SECRET), but my understanding is we want people to change this anyway so that's fine.

@b-rowan
Copy link
Collaborator

b-rowan commented Sep 11, 2024

Trying to upload software is failing for me, with the following error -

nginx-1     | 2024/09/11 19:27:06 [warn] 24#24: *4 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000023, client: 172.18.0.1, server: _, request: "POST /ui/bff/software HTTP/2.0", host: "0.0.0.0", referrer: "https://0.0.0.0/ui/software"

@easybe
Copy link
Collaborator Author

easybe commented Sep 11, 2024

Looks good to me, will do some testing.

Only concern is the hard coding of variables (like GOOSEBIT_SECRET), but my understanding is we want people to change this anyway so that's fine.

This is just an example and of course, should not be used as-is. With Docker Compose, secrets can be put in a .env file. How secrets are handled heavily depends on the software used for deployment.

@easybe
Copy link
Collaborator Author

easybe commented Sep 11, 2024

Trying to upload software is failing for me, with the following error -

nginx-1     | 2024/09/11 19:27:06 [warn] 24#24: *4 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000023, client: 172.18.0.1, server: _, request: "POST /ui/bff/software HTTP/2.0", host: "0.0.0.0", referrer: "https://0.0.0.0/ui/software"

It's a permissions issue. We should fix that in the image. Will do that together with the other pending fixes.

@easybe easybe marked this pull request as draft September 11, 2024 21:25
@easybe easybe force-pushed the gardena/eb/docker_compose branch 2 times, most recently from 5565d63 to 1f2c196 Compare September 26, 2024 22:10
@easybe
Copy link
Collaborator Author

easybe commented Sep 26, 2024

@b-rowan how about a v0.2.4? The latest image on Docker Hub is still broken, which is a problem if someone wants to try it out…

@b-rowan
Copy link
Collaborator

b-rowan commented Sep 26, 2024

On it 🫡

@b-rowan
Copy link
Collaborator

b-rowan commented Sep 26, 2024

On it 🫡

I think this is working now? I was able to get the build up and running using the example on my desktop, although I havent tested uploading yet.

EDIT: Even uploading works.

This demonstrates how to deploy the service in production using the
Docker image together with NGINX and PostgreSQL.

Run with:

    docker compose -f docker/demo/docker-compose.yml up

The service can then be accessed under: https://localhost
@easybe easybe force-pushed the gardena/eb/docker_compose branch from 1f2c196 to 14cb5a7 Compare September 27, 2024 09:12
@easybe easybe marked this pull request as ready for review September 27, 2024 09:16
@easybe
Copy link
Collaborator Author

easybe commented Sep 27, 2024

Yes, seems fine now.

Moved the files to docker/demo.

Copy link
Collaborator

@b-rowan b-rowan left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@easybe easybe merged commit 4840bf3 into UpstreamDataInc:master Sep 27, 2024
2 checks passed
@embetrix
Copy link

I get "Software swu header cannot be parsed" error message when using the docker compose and upload an SWU file.

@b-rowan
Copy link
Collaborator

b-rowan commented Sep 27, 2024

I get "Software swu header cannot be parsed" error message when using the docker compose and upload an SWU file.

What format are you using for versioning? That's likely where that's failing, right now goosebit expects a semantic version.

@easybe
Copy link
Collaborator Author

easybe commented Sep 27, 2024

It could also be a permissions problem (of /artifacts). Make sure you pull the latest image and re-create the volumes:

docker compose down --volumes
docker compose up --pull always

@embetrix
Copy link

my swu package is : my-image-qtdemo-update-stm32mp157f-dk2_0.6.1.swu are there specific format it should be followed ?

the volumes are clean, I just pulled today.

@easybe
Copy link
Collaborator Author

easybe commented Sep 27, 2024

Unfortunately, logging needs some fixing. Could you try again with

image: upstreamdata/goosebit:wip

and post the log output?

@b-rowan
Copy link
Collaborator

b-rowan commented Sep 27, 2024

my swu package is : my-image-qtdemo-update-stm32mp157f-dk2_0.6.1.swu are there specific format it should be followed ?

the volumes are clean, I just pulled today.

Not a versioning in the naming, but the version in the software-description

@embetrix
Copy link

Ah, didn't see this information in the docs. I use by the way encrypted sw-description :
https://github.com/sbabic/swupdate/blob/master/Kconfig#L494

IMHO Goosebit should not have this restriction :-(

@easybe
Copy link
Collaborator Author

easybe commented Sep 28, 2024

Ah, didn't see this information in the docs. I use by the way encrypted sw-description : https://github.com/sbabic/swupdate/blob/master/Kconfig#L494

IMHO Goosebit should not have this restriction :-(

Keep in mind that gooseBit is still under heavy development and not feature complete/bug free. If you have ideas/suggestions on how to improve it, feel free to create an issue, or even better a PR.

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.

Docker Support
3 participants