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 params for package versions #86

Closed
wants to merge 1 commit into from

Conversation

hrodmn
Copy link
Contributor

@hrodmn hrodmn commented Nov 23, 2023

What I am changing

  • make it possible to configure the versions of these packages without custom runtimes
    • tipg
    • titiler-pgstac
    • stac-fastapi
    • pgstac

How I did it

  • added a constant to the top of each relevant typescript file with the default version as specified in v6.1.0
  • added new arguments to the relevant constructs
    • TitilerPgstacApiLambda: titiler_pgstac_version
    • PgStacApiLambda: stac_fastapi_version
    • PgStacDatabase: pgstac_version
    • TiPgApiLambda: tipg_version
  • used docker build args to specify the versions at build time

How you can test it

  • run an eoapi-template deployment with no versions specified - this should yield an identical deployment to v6.1.0
  • run an eoapi-template deployment with user-specified versions of titiler-pgstac, tipg, pgstac, stac-fastapi
    # STAC DB
    pgstac_db = PgStacDatabase(
        self,
        "pgstac-db",
        pgstac_version="0.8.2",
        ...
    )
    
    # titiler-pgstac
    TitilerPgstacApiLambda(
        self,
        "titiler-pgstac-api",
        titiler_pgstac_version="0.7.10",
        ...
    )
    
    # stac-fastapi
    stac_api_lambda = PgStacApiLambda(
        self,
        "pgstac-api",
        stac_fastapi_version="2.4.9",
        ...
    )
    
    # tipg
    TiPgApiLambda(
        self,
        "tipg-api",
        tipg_version="0.5.1",
        ...
    )

Related Issues

* tipg
* titiler-pgstac
* stac-fastapi
* pgstac
@hrodmn hrodmn force-pushed the config-package-versions branch from 224a60e to 98af06f Compare November 23, 2023 19:15
@hrodmn
Copy link
Contributor Author

hrodmn commented Nov 24, 2023

I tried launching a stack with pgstac==0.8.1 and got an error in the bootstrap process:

...
Running migrations...
Unable to bootstrap database with exception=must be member of role "pgstac_ingest"

python traceback:

[ERROR] InsufficientPrivilege: must be member of role "pgstac_ingest"
Traceback (most recent call last):
  File "/var/task/handler.py", line 232, in handler
    raise e
  File "/var/task/handler.py", line 205, in handler
    Migrate(pgdb).run_migration(params["pgstac_version"])
  File "/var/task/pypgstac/migrate.py", line 149, in run_migration
    cur.execute(migration_sql)
  File "/var/task/psycopg/cursor.py", line 737, in execute
    raise ex.with_traceback(None)

I think this is a case where the handler code might need to be updated to accommodate changes in one of the dependencies (pgstac). Would it make sense to restrict to particular major/minor versions to prevent errors like this? In this case, pgstac==0.7.10 works fine but pgstac==0.8.2 does not.

We could use the semver package to check that the supplied version of pgstac is <0.8. I am not exactly sure how we would set the limits for other packages but maybe something to consider for pgstac right now.

@emileten
Copy link
Contributor

Thanks for the PR !

I thought for a second that not only the handler but also the default pinned dependencies versions could become a concern if they are incompatible with a user provided library version, but actually, if such a incompatibility arises, it would appear when the stack synthesizes, which is fine.

We could use the semver package

That looks like a solution

@hrodmn
Copy link
Contributor Author

hrodmn commented Nov 29, 2023

I'm closing this after more discussion in #85 that suggests we don't want to go down this road.

@hrodmn hrodmn closed this Nov 29, 2023
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.

add config settings for package versions (e.g. titiler-pgstac==0.5.1)
2 participants