Skip to content

Commit

Permalink
Remove minio support
Browse files Browse the repository at this point in the history
  • Loading branch information
serra committed Oct 10, 2024
1 parent 7244c10 commit 1f98aa0
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 124 deletions.
6 changes: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
MINIO_ENDPOINT=play.minio.io:9000
MINIO_ACCESS_KEY=Q3AM3UQ867SPQQA43P2F
MINIO_SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
DEFAULT_BUCKET="floridayvine-testbucket"
FLORIDAY_CLIENT_ID=your_client_id
FLORIDAY_CLIENT_SECRET=ypur_client_secret
FLORIDAY_AUTH_URL="https://idm.staging.floriday.io/oauth2/ausmw6b47z1BnlHkw0h7/v1/token"
FLORIDAY_BASE_URL="https://api.staging.floriday.io/suppliers-api-2024v1"
FLORIDAY_API_KEY=your_api_key
FLORIDAY_API_KEY=your_api_key
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- Minio functionality has been completely removed from the project
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ Done syncing organizations
Follow the steps in Development.
See the [tests](./tests) directory for example usages.

Once the files are uploaded to Minio, you can create a virtual dataset in your data lake
as described in this [Serra Learning on formatting a directory as a dataset].

### As a Container in Serra Vine

See [docker-compose.yml](./docker-compose.yml) for an example to configure the service in Serra Vine.
Expand All @@ -76,4 +73,3 @@ Your environment variables can be configured in the compose file or in a separat
[Floriday]: https://www.floriday.io/en/home
[Serra Vine]: https://vine.serraict.com
[backlog]: ./work/backlog.md
[Serra Learning on formatting a directory as a dataset]: https://serra.fibery.io/Public/Learning/Een-virtuele-dataset-maken-van-een-directory-met-json-bestanden-247?sharing-key=b3769410-f4ab-4926-800e-87e345f535b2
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [
]
requires-python = ">=3.10"
urls = { "project" = "https://github.com/serraict/vine-floriday-adapter", "docs" = "https://github.com/serraict/vine-floriday-adapter/blob/main/README.md" }
dependencies = ["typer", "minio", "requests", "floriday-supplier-client", "pymongo"]
dependencies = ["typer", "requests", "floriday-supplier-client", "pymongo"]
dynamic = ["version"]
license.file = "LICENCE"

Expand Down
11 changes: 3 additions & 8 deletions src/floridayvine/__main__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from dataclasses import dataclass
import typer
from .minio import MinioClient
from .commands import version, minio, floriday, database, sync
from .commands import version, floriday, database, sync

app = typer.Typer()


@dataclass
class Common:
minio: MinioClient
pass


def register_commands():
app.add_typer(version.app, name="version")
app.add_typer(minio.app, name="minio")
app.add_typer(floriday.app, name="floriday")
app.add_typer(database.app, name="db")
app.add_typer(sync.app, name="sync")
Expand All @@ -22,11 +20,8 @@ def register_commands():
@app.callback()
def common(
ctx: typer.Context,
minio_endpoint: str = typer.Option(..., envvar="MINIO_ENDPOINT"),
minio_access_key: str = typer.Option(..., envvar="MINIO_ACCESS_KEY"),
minio_secret_key: str = typer.Option(..., envvar="MINIO_SECRET_KEY"),
):
ctx.obj = Common(MinioClient(minio_endpoint, minio_access_key, minio_secret_key))
ctx.obj = Common()


def main():
Expand Down
17 changes: 0 additions & 17 deletions src/floridayvine/commands/minio.py

This file was deleted.

1 change: 0 additions & 1 deletion src/floridayvine/commands/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ def about(ctx: typer.Context):
"Floriday Vine is a Python package to ingest Floriday trade information into Serra Vine."
)
print(f" v{get_version()}")
print(f" Minio endpoint: {ctx.obj.minio.endpoint}")
19 changes: 0 additions & 19 deletions src/floridayvine/minio.py

This file was deleted.

63 changes: 0 additions & 63 deletions tests/test_upload_files_to_vine.py

This file was deleted.

21 changes: 15 additions & 6 deletions work/backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,27 @@ Containers are pushed to <https://ghcr.io/serraict/vine-floriday-adapter>.

## Next

* Goal: have a decent developer experience
* organize typer commands into submodules
* Goal: Cleanup codebase and do the first deploy to a Serra Vine environment
* (Must, M) Create script to verify environment variables
- Develop a Python script to check .env.default and .env.example files
- Script should compare variables used in the application against those defined in .env files
- Implement error reporting for missing or mismatched variables
- Add script to CI/CD pipeline
- Acceptance: Script successfully identifies all used variables and reports discrepancies
* (Should, L) Deploy to a Serra Vine production system
- Prepare deployment documentation
- Set up necessary credentials and access for production environment
- Configure CI/CD pipeline for automated deployment
- Perform a test deployment to staging environment
- Execute production deployment
- Verify functionality in production environment
- Acceptance: Application successfully deployed and running in Serra Vine production system

## Later

* Goal: show open quotations for a supplier on Floriday.
* Sync organizations to local database
* For now: create a csv that we place in Mino and read with dremio
* Sync from base
* Sync from a specific sequence number
* Sync trade items to local database
* Sync batches (optional)
* Sync direct sales
* create a Serra Vine dashboard for open quotations
* Goal: learn/ understand the FLoriday api
Expand Down
4 changes: 4 additions & 0 deletions work/definition-of-done.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Running `make release` will take care of:
- [x] Release is tagged in the repository
- [x] GitHub Actions package workflow successfully builds and publishes the Docker container to <https://ghcr.io/serraict/vine-floriday-adapter>.

Additionally, for each release:

- [ ] CHANGELOG.md is updated following the guidelines from https://keepachangelog.com/, documenting all changes since the last release

## Final Checks

- [ ] GitHub Actions CI workflow passes on the main branch, running all quality checks
Expand Down

0 comments on commit 1f98aa0

Please sign in to comment.