Skip to content

Conversation

@spawnia
Copy link
Contributor

@spawnia spawnia commented May 18, 2022

Resolves #1477
Resolves #882

Provides a simple and canonical way to make modifications of the Sentry base image, such as installing plugins or their dependencies.

In contrast to previous solutions, this method:

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link
Collaborator

@aminvakil aminvakil left a comment

Choose a reason for hiding this comment

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

I would say let's keep this PR to moving from using sentry image to building sentry image and do stuff after.

And open another PRs for other modifications.

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

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

Looks pretty great so far, thanks for putting this effort in. I'll leave the final approval to @chadwhitacre (he needs to approve to land anyway).

That said please address my comments regarding test.sh file as otherwise you'll break builds in all other Sentry repos :) -- @chadwhitacre we should probably add a simple GHA check for that here instead of using me as a human e2e/lint check 😅

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

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

LGTM, great work thanks a lot 👏🏻

Co-authored-by: Amin Vakil <[email protected]>
@chadwhitacre
Copy link
Member

Thanks for the contribution @spawnia and for reviewing @BYK @aminvakil!

Kicking off CI ...

/gcbrun

echo "sentry-auth-oidc" >> sentry/requirements.txt
./install.sh --minimize-downtime
./_integration-test/run.sh
run: ./integration-test.sh
Copy link
Member

Choose a reason for hiding this comment

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

The main purpose of factoring this out is to make it easier to run locally, yes? (cf. CONTRIBUTING.md). In that case, how does ./integration-test.sh relate to ./test.sh? Looks like there has been some back and forth on this with 004d41b. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main purpose of factoring this out is to make it easier to run locally, yes?

Exactly.

In that case, how does ./integration-test.sh relate to ./test.sh?

I am not sure how to answer this. I think their purpose follows from their contents and usage in the project. Would you like to rename them or comment them?


source ../install/dc-detect-version.sh

# Negated version of ensure-customizations-not-present.sh, make changes in sync
Copy link
Member

Choose a reason for hiding this comment

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

Almost certainly a way to DRY this up.

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 am sure there is, I am not convinced it is worth the effort though. I do follow DRY, but also WET - write everything twice. Given this is a negation, we will never need to maintain more than two versions of this.

Copy link
Member

@chadwhitacre chadwhitacre left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Some initial questions, not sure we're there yet on how test code is organized between the different scripts ... but I think we can get there. :)

@chadwhitacre
Copy link
Member

/gcbrun

@chadwhitacre chadwhitacre merged commit 9eff0c3 into getsentry:master May 25, 2022
@chadwhitacre
Copy link
Member

Thanks @spawnia! Merging as-is, I think there are some slight improvements possible but don't want to hold this up further. :)

@spawnia spawnia deleted the enhance-image branch May 25, 2022 16:59
@spawnia
Copy link
Contributor Author

spawnia commented May 25, 2022

Thanks to everyone involved. Looking forward to simplifying our setup with this.

@PMExtra
Copy link

PMExtra commented May 26, 2022

Great job!

But why do we have to migrate from requirements.txt to enhance-image.sh ?

I think they can coexist. In some cases, use requirements.txt is simpler than shell script.

I think we can drop the requirements.txt is deprecated message, then everything will be awesome.

@spawnia
Copy link
Contributor Author

spawnia commented May 26, 2022

I think the simplicity of having a single shell script is preferrable.

requirements.txt pretty much only saves the addition of pip install, but at the added cost of:

  • having an extra file
  • having to document two ways of achieving the same thing
  • missing clarity as to the order of execution - one more thing to think about or document

@PMExtra
Copy link

PMExtra commented May 26, 2022

@spawnia OK, you're right.
I used to think that shell is not a "pretty" format to specify multiple packages and their version constraints.
But now I found a solution like that:

requirements=(
sentry-auth-ldap==21.9.*
sentry-tablestore==git+https://github.com/PMExtra/sentry-tablestore.git@master
)

pip install ${requirements[@]}

@chadwhitacre
Copy link
Member

Nice hack @PMExtra. :)

@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install plugins in web and sentry-cleanup Add required libraries for sentry-ldap-auth to base Sentry image

5 participants