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

chore: Fix Pixano deployed app #29

Merged
merged 12 commits into from
Jan 15, 2024
Merged

chore: Fix Pixano deployed app #29

merged 12 commits into from
Jan 15, 2024

Conversation

cpvannier
Copy link
Member

@cpvannier cpvannier commented Jan 10, 2024

Description

With the merge of Pixano Annotator and Explorer in #23 and #27, and the use of svelteKit with the new ImageWorkspace, running the Pixano deployed app is not yet working and needs to be fixed.

Warning: breaking change for local run

To run the backend locally you should now use LIBRARY_DIR instead of DATA_DIR (and pixano.app instead of pixano.apps as of #27):

LIBRARY_DIR=your_datasets_directory/ uvicorn pixano.app:create_app --factory --reload

And S3 parameters are now named:

  • endpoint_url
  • region_name
  • aws_access_key
  • aws_secret_key
  • local_model_dir

Using S3 datasets

For datasets on S3 storage, you can add the required parameters similarly to LIBRARY_DIR:

LIBRARY_DIR=my_s3_path ENDPOINT_URL=aws AWS_ACCESS_KEY=password uvicorn pixano.app:create_app --factory --reload

For the deployed app installed with PyPI, LIBRARY_DIR is an argument while S3 parameters are options added to the command with --{option_name}:

Usage: pixano [OPTIONS] LIBRARY_DIR

  Launch Pixano App in LIBRARY_DIR

  LIBRARY_DIR is the local or S3 path to your dataset library

Options:
  --endpoint_url TEXT     S3 endpoint URL, use 'AWS' if not provided.
                          Used if library_dir is an S3 path
  --region_name TEXT      S3 region name, not always required for private
                          storages. Used if library_dir is an S3 path
  --aws_access_key TEXT   S3 AWS access key. Used if library_dir is an S3
                          path
  --aws_secret_key TEXT   S3 AWS secret key. Used if library_dir is an S3
                          path
  --local_model_dir TEXT  Local path to your models. Used if library_dir
                          is an S3 path
  --host TEXT             Pixano app URL host  [default: 127.0.0.1]
  --port INTEGER          Pixano app URL port  [default: 0]
  --help                  Show this message and exit.

For example:

pixano my_s3_path --endpoint_url aws --aws_access_key password

Changes

Fixed

  • Fix build paths for Pixano app
  • Fix getting Pixano app settings with lru_cache for deployed app and unit tests
  • Fix accessing S3 dataset settings in deployed app
  • Remove outdated comment
  • Revert lancedb and pylance versions to older versions to prevent issues with some datasets (pixano/pixano-project-manager#8)

@cpvannier cpvannier added the enhancement New feature or request label Jan 10, 2024
@cpvannier cpvannier self-assigned this Jan 10, 2024
Temporary rollback as newer versions of lancedb and lance currently cause issues when loading and saving items
Fixes routers not being to access shared settings when running the app in deployed mode or in unit tests
@cpvannier cpvannier added the scope: back Related to Pixano backend label Jan 12, 2024
@cpvannier cpvannier marked this pull request as ready for review January 12, 2024 10:06
@cpvannier

This comment was marked as resolved.

@cpvannier cpvannier changed the title chore: Fix Pixano build chore: Fix Pixano deployed app Jan 12, 2024
Add a model_dir attribute in app settings that is either local_model_dir in case of S3 library or data_dir / "models" in case of local library
@cpvannier cpvannier marked this pull request as draft January 12, 2024 15:57
@cpvannier

This comment was marked as resolved.

@cpvannier cpvannier marked this pull request as ready for review January 15, 2024 09:12
@cpvannier cpvannier merged commit d169b5d into develop Jan 15, 2024
5 checks passed
@cpvannier cpvannier added this to the Pixano 0.5.0 milestone Jan 16, 2024
@cpvannier cpvannier deleted the chore/fix-build branch January 31, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scope: back Related to Pixano backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants