Skip to content

Fotobox #189

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

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

Fotobox #189

wants to merge 6 commits into from

Conversation

Luke-Roy-IBM
Copy link
Member

Initial Pull request with the IBM Fotobox

@Luke-Roy-IBM
Copy link
Member Author

@reggeenr Initial Pull request for the Fotobox

Copy link
Collaborator

@reggeenr reggeenr left a comment

Choose a reason for hiding this comment

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

Hi,

thanks for pulling together this PR.

I suggest to apply a spelling check for the Readme. Apart from that, it would be great if we could migrate the COS integration to make use Trusted Profiles. The trusted profile setup should be doable with terraform, too.

One thing that needs to get addressed before merging this one, is to adjust the dockerfile and make sure to not rely on Dockerhub and to use scratch images, if possible.

@@ -0,0 +1,75 @@
# IBM Fotobox

This is the IBM Fotobox. Deploy your own Fotobox straight to the IBM Cloud Access it directly from any device with browser and camera. Take Pictures and view them all from your device.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
This is the IBM Fotobox. Deploy your own Fotobox straight to the IBM Cloud Access it directly from any device with browser and camera. Take Pictures and view them all from your device.
This is the IBM Fotobox. Deploy your own Fotobox straight to the IBM Cloud, and access it directly from any device with browser and camera. Take pictures and view them all from your device.


The solution is based on:
- The frontend a Svelte Single Page Application running as a App on Code Engine able to scale to 0 in oder to optimise cost.
- The Upload function which generates a thumbnail of the image and stores both in COS written in Python and running as a Function on Code Engine.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- The Upload function which generates a thumbnail of the image and stores both in COS written in Python and running as a Function on Code Engine.
- The "upload" function which generates a thumbnail of the image and stores both in COS written in Python and running as a Code Engine function.

This is the IBM Fotobox. Deploy your own Fotobox straight to the IBM Cloud Access it directly from any device with browser and camera. Take Pictures and view them all from your device.

The solution is based on:
- The frontend a Svelte Single Page Application running as a App on Code Engine able to scale to 0 in oder to optimise cost.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- The frontend a Svelte Single Page Application running as a App on Code Engine able to scale to 0 in oder to optimise cost.
- The "frontend" a Svelte Single Page Application (SPA) running as a Code Engine app, that is able to scale to 0 in oder to optimise cost.

The solution is based on:
- The frontend a Svelte Single Page Application running as a App on Code Engine able to scale to 0 in oder to optimise cost.
- The Upload function which generates a thumbnail of the image and stores both in COS written in Python and running as a Function on Code Engine.
- The Downloader a Go programm designed to serve the images stored in COS or download all at one go if you are the operator of the fotobox.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- The Downloader a Go programm designed to serve the images stored in COS or download all at one go if you are the operator of the fotobox.
- The "downloader" a Go program designed to serve the images stored in COS or download all at one go if you are the operator of the fotobox.

- The frontend a Svelte Single Page Application running as a App on Code Engine able to scale to 0 in oder to optimise cost.
- The Upload function which generates a thumbnail of the image and stores both in COS written in Python and running as a Function on Code Engine.
- The Downloader a Go programm designed to serve the images stored in COS or download all at one go if you are the operator of the fotobox.
- All Images are stored in IBM Cloud Object Storage to ensure security and scalability.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- All Images are stored in IBM Cloud Object Storage to ensure security and scalability.
- All images are stored in IBM Cloud Object Storage to ensure security and scalability.

ibmcloud ce app create --name fotobox-get-pics --build-dockerfile Dockerfile --build-source download-app
```

4. Create a Secret map containing the following values. use the following command to create the password
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
4. Create a Secret map containing the following values. use the following command to create the password
4. Create a secret map containing the following values. Use the following command to create the password

}
}

#resource "ibm_code_engine_secret" "registry_secret" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we don't need that because we are serving the fotobox from a public image, right?

@@ -0,0 +1,31 @@
FROM golang:1.23
Copy link
Collaborator

Choose a reason for hiding this comment

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

please don't use a dockerhub image as base image.

I suggest to take a look at the following dockerfile that gives you a working example that builds a scratch image

Credentials: ibmiam.NewStaticCredentials(
aws.NewConfig(),
authEndpoint,
apiKey,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you considered to migrate this to trusted profiles at a later point in time?

@@ -0,0 +1,25 @@
FROM --platform=linux/amd64 node:22 as build
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should not use dockerhub images as base images.

Following example can probably help you to adopt a Node.js scratch image
https://github.com/IBM/CodeEngine/blob/main/cos-to-sql/Dockerfile

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