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

core/plugins: add per-plugin env vars #11526

Merged
merged 4 commits into from
Jan 24, 2024
Merged

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Dec 8, 2023

@jmank88 jmank88 requested a review from patrickhuie19 December 8, 2023 15:57
Copy link
Contributor

github-actions bot commented Dec 8, 2023

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@jmank88 jmank88 force-pushed the BCF-2382-loopp-memlimit branch 4 times, most recently from f2df8f1 to 4741b2f Compare December 20, 2023 18:10
@jmank88 jmank88 changed the title core/plugins: add per-plugin GOMEMLIMIT core/plugins: add per-plugin env vars Dec 20, 2023
@jmank88 jmank88 force-pushed the BCF-2382-loopp-memlimit branch 3 times, most recently from 15a99a4 to 72459a5 Compare January 5, 2024 16:02
@jmank88 jmank88 force-pushed the BCF-2382-loopp-memlimit branch from 72459a5 to 7278204 Compare January 18, 2024 19:14
@jmank88 jmank88 force-pushed the BCF-2382-loopp-memlimit branch from 7278204 to 3b03976 Compare January 18, 2024 19:26
@jmank88 jmank88 requested review from cedric-cordenier and a team January 18, 2024 19:30
@jmank88 jmank88 marked this pull request as ready for review January 18, 2024 19:30
@jmank88 jmank88 requested review from krehermann and a team as code owners January 18, 2024 19:30

// ParseEnvFile returns a slice of key/value pairs parsed from the file at filepath.
// As a special case, empty filepath returns nil without error.
func ParseEnvFile(filepath string) ([]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking through if this should live in chainlink-common, but it's probably best here.

patrickhuie19
patrickhuie19 previously approved these changes Jan 18, 2024
@jmank88 jmank88 enabled auto-merge January 22, 2024 16:26
vyzaldysanchez
vyzaldysanchez previously approved these changes Jan 22, 2024
@jmank88
Copy link
Contributor Author

jmank88 commented Jan 22, 2024

Ah, foiled by sonar. Will need to update.

defer func() {
_ = f.Close()
}()
m, err := envparse.Parse(f)
Copy link
Contributor

Choose a reason for hiding this comment

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

are there any security considerations we are overlooking with this strategy? we have gone from a limited, specific set of env var to an unlimited set.

it seems like you might be able to use this as a hook into parts of the system that shouldn't be hooked into (like the db?) maybe nbd since whoever is running the software has full control over the env anyway.

in any case, it seems like we need a readme and some guidance about how to use the env file, or something in the changlelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the changelog. Does it need to say more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have gone from a limited, specific set of env var to an unlimited set.

The env was already controlled by the node op since the host env is inherited. This just gives them fine gained control, per-plugin.

it seems like you might be able to use this as a hook into parts of the system that shouldn't be hooked into (like the db?) maybe nbd since whoever is running the software has full control over the env anyway.

I don't fully grok the DB hook, but yeah that would already be possible before this change.

@cl-sonarqube-production
Copy link

@jmank88 jmank88 added this pull request to the merge queue Jan 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 24, 2024
@jmank88 jmank88 added this pull request to the merge queue Jan 24, 2024
Merged via the queue into develop with commit b7260d4 Jan 24, 2024
94 checks passed
@jmank88 jmank88 deleted the BCF-2382-loopp-memlimit branch January 24, 2024 16:28
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.

5 participants