A Python app for retrieving images from Samba server, cropping them using the Cloudinary AI service, and syncing them with a Google Cloud Storage bucket. This application is intended to run as a Kubernetes job or a standalone cronjob.
- Retrieve images from Samba Share.
- Crop images using the Cloudinary AI service.
- Sync cropped images with a Google Cloud Storage bucket.
- Deployable as a Kubernetes job or a standalone cronjob.
The app requires the following environment variables to be set:
Environment Variable | Description |
---|---|
GOOGLE_APP_CREDENTIALS |
Path to the JSON file that contains your Google application credentials. |
IC_BUCKET_NAME |
The name of the Google Cloud Storage bucket where cropped images will be synced. |
SMB_USERNAME |
SMB share username. |
SMB_PASSWORD |
SMB share password. |
SMB_SERVER |
Name or IP address of Samba server. |
SMB_SHARE |
SMB share name or directory location. |
TARGET_IMAGE_WIDTH |
Target width of output images. |
TARGET_IMAGE_HEIGHT |
Target height of output images. |
CLOUDINARY_URL |
The Cloudinary URL for accessing the Cloudinary API. |
- Dockerfile: Build a Docker image for the app.
- Helm Chart: Helm chart for deploying the app in a Kubernetes cluster.
- Ensure your Kubernetes cluster is up and running.
- Configure your environment variables in your values file.
- Deploy the Helm chart:
helm install imagecropper ./helm
- Build the Docker image:
docker build -t imagecropper .
- Run the Docker container with the necessary environment variables:
docker run -e GOOGLE_APP_CREDENTIALS=<your-google-app-credentials> \ -e IC_BUCKET_NAME=<your-bucket-name> \ -e SMB_USERNAME=<your-smb-user> \ -e SMB_PASSWORD=<your-smb-secret> \ -e SMB_SERVER=<your-smb-server> \ -e SMB_SHARE=<your-smb-share> \ -e CLOUDINARY_URL=<your-cloudinary-url> \ imagecropper
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.