Skip to content

Conversation

@candleindark
Copy link
Member

@candleindark candleindark commented May 30, 2025

See commit message for details.

This PR closes #223.

TODOs (more like blocks)

@candleindark
Copy link
Member Author

@aaronkanzer @kabilar Do you know where, which repo, I can modify to apply the same changes to LINC?

@yarikoptic
Copy link
Member

@waxlamp please review this PR from your side of infra -- it should not effect running instance but would allow for vendorization on which there is work ongoing in dandi/dandi-schema#294 and from there on.

@kabilar
Copy link
Member

kabilar commented Jul 8, 2025

@aaronkanzer @kabilar Do you know where, which repo, I can modify to apply the same changes to LINC?

Thanks @candleindark. Here is the LINC terraform repo: https://github.com/lincbrain/linc-archive-infrastructure

terraform/api.tf Outdated

additional_django_vars = {
DANDI_INSTANCE_NAME = "DANDI"
DANDI_DOI_PREFIX = "10.48324"
Copy link
Member

Choose a reason for hiding this comment

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

A couple of questions.

  1. What is the intended use of these vars? They are specified in the additional_django_vars section, but lack the DJANGO_* prefix on them.
  2. We already have a env var DJANGO_DANDI_DOI_API_PREFIX, which specifies the same value as DANDI_DOI_PREFIX. So is this additional redundant?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, after looking into it further it seems they are passed to the schema. I do wonder if there's a better place to set these, but I imagine not.

Copy link
Member Author

@candleindark candleindark Jul 14, 2025

Choose a reason for hiding this comment

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

  1. What is the intended use of these vars? They are specified in the additional_django_vars section, but lack the DJANGO_* prefix on them.

Just as you noted, they are used to set the configuration in dandischema, https://github.com/dandi/dandi-schema/blob/f2ecf9d9b5cb6cff8ef0a3a1de427044cfb3e59d/dandischema/conf.py#L21-L63. My understanding is that variables defined in additional_django_vars don't have to start with the DJANGO_*. The set configuration in dandischema is be shared among dandi-cli and dandi-archive in order to "vendorize" DANDI, dandi/dandi-schema#294.

  1. We already have a env var DJANGO_DANDI_DOI_API_PREFIX, which specifies the same value as DANDI_DOI_PREFIX. So is this additional redundant?

Yes, it is redundant, but since the shared config is not just used in dandi-archive having an env variable starting DJANGO_* may not be appropriate. It may be a good idea to eliminate DJANGO_DANDI_DOI_API_PREFIX in the future though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, after looking into it further it seems they are passed to the schema. I do wonder if there's a better place to set these, but I imagine not.

The configuration must be set correctly before dandischema.models is imported. Providing those env vars will achieve that in dandi-archive.

Copy link
Member

Choose a reason for hiding this comment

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

The configuration must be set correctly before dandischema.models is imported. Providing those env vars will achieve that in dandi-archive.

Can we not use set_instance_config, instead of the env vars?

Copy link
Member

Choose a reason for hiding this comment

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

@jjnesbitt manually how so that it is in effect at dandischema library import?

Copy link
Member

Choose a reason for hiding this comment

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

Manually via set_instance_config, instead of with environment variables.

Copy link
Member Author

Choose a reason for hiding this comment

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

Manually via set_instance_config, instead of with environment variables.

If calling of set_instance_config() is necessitated because of naming of variables. I can introduce aliases to the fields of dandischema.conf.Config so that they can be set via DJANGO_DANDI_DOI_API_PREFIX and DJANGO_DANDI_INSTANCE_NAME.

Copy link
Member

Choose a reason for hiding this comment

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

ok, let's finalize/merge

and then establish needed changes in dandi-archive for .set_instance_config . @jjnesbitt would you do that or should we try a PR?

Copy link
Member

Choose a reason for hiding this comment

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

I can make that PR.

@yarikoptic
Copy link
Member

@jjnesbitt @waxlamp please chime in on either you want anything else changed. It should prepare our instance for use of vendorized instance of dandischema

@candleindark
Copy link
Member Author

candleindark commented Aug 18, 2025

Note
At this point, the instance config of dandischema used by dandi-archive will most likely to be set by calling set_instance_config. As to where/how to call set_instance_config in dandi-archive, please checkout dandi/dandi-archive#2483 (comment).

@candleindark
Copy link
Member Author

@jjnesbitt This PR has been updated and is ready for review. All environment variables used now conform to the DJANGO_DANDI_ prefix format.

@candleindark candleindark marked this pull request as ready for review September 30, 2025 06:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds vendor-specific configuration for DANDI instances by introducing environment variables for instance name and identifier. The changes support vendorization of the publisher for DataCite integration and provide runtime configuration for different deployment environments.

Key changes:

  • Added DJANGO_DANDI_INSTANCE_NAME environment variable for both staging and production
  • Added DJANGO_DANDI_INSTANCE_IDENTIFIER environment variable with RRID identifier

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
terraform/staging_pipeline.tf Adds instance name "DANDI-STAGING" and RRID identifier for staging environment
terraform/api.tf Adds instance name "DANDI" and RRID identifier for production environment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@candleindark candleindark changed the title Allow vendor specific info to be provided Set environment vars to set vendor-specific dandi-schema used by the DANDI instance Sep 30, 2025
candleindark added a commit to candleindark/dandi-infrastructure that referenced this pull request Oct 21, 2025
@jjnesbitt jjnesbitt merged commit d73af24 into dandi:master Nov 6, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Multi-DANDI instance support Nov 6, 2025
@candleindark candleindark deleted the vendor-envirn branch November 11, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Provide configuration for upcoming dandischema release with vendorization support

5 participants