Skip to content

Set container URLs for tests running in GitHub Actions #1921

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

acdha
Copy link
Contributor

@acdha acdha commented Dec 7, 2023

@acdha acdha enabled auto-merge (rebase) December 7, 2023 18:48
@acdha acdha force-pushed the github-actions-set-test-search-engine-urls branch 3 times, most recently from cbf86fc to 9264f3d Compare December 7, 2023 20:59
acdha added 4 commits December 8, 2023 11:08
The old code assumed the non-standard port which the test runner has used for a long, long time to avoid conflicts with other Solr instances on the same host. Since that’s a) ancient history and b) moot in an isolated CI environment, we’ll drop it rather than remapping.
@acdha acdha force-pushed the github-actions-set-test-search-engine-urls branch from c97a347 to 3fd8418 Compare December 8, 2023 16:09
@acdha
Copy link
Contributor Author

acdha commented Dec 8, 2023

@cclauss Some progress but this hit a harder point: GitHub Actions won't let you customize the entry point for a service container which means that we can't easily create the core using the solr-precreate command. I think we can do it entirely by creating the core through the API but that may be somewhat tedious.

Unfortunately, without the ability to customize entrypoints
(https://github.com/orgs/community/discussions/26688) this can't use the
standard upstream approach unless we want to build a custom container
image just for tests:

https://solr.apache.org/guide/solr/latest/deployment-guide/solr-in-docker.html#custom-set-up-scripts
@acdha acdha force-pushed the github-actions-set-test-search-engine-urls branch from 80c06cf to 5d40cff Compare December 8, 2023 16:44
Comment on lines 55 to 58
run: curl -fs --retry 30 --retry-all-errors --retry-delay 2 http://localhost:8983/solr/admin/cores?action=CREATE&name=collection1&instanceDir=/opt/solr/server/solr/mycores/collection1&config=conf/solrconfig.xml&schema=conf/schema.xml
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Copy link
Contributor

@cclauss cclauss Dec 8, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor

@cclauss cclauss Dec 30, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 good pointer!

Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Minor comments.

status_url = "http://localhost:9001/solr/collection1/admin/ping"
status_url = "http://%s:%s/solr/collection1/admin/ping" % (
os.environ.get("SOLR_HOST", "localhost"),
os.environ.get("SOLR_PORT", "9001"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we default to the default Solr port?

Suggested change
os.environ.get("SOLR_PORT", "9001"),
os.environ.get("SOLR_PORT", "8983"),

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 should - just need to update that in every spot but the old port choices date back to when people were running the test daemons locally without Docker

acdha and others added 2 commits January 17, 2024 19:06
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@cclauss
Copy link
Contributor

cclauss commented Jan 18, 2024

Please rebase to pick up the .github/workflows/test.yml changes from

@cclauss
Copy link
Contributor

cclauss commented Feb 6, 2024

Please rebase to resolve git conflicts.

@cclauss
Copy link
Contributor

cclauss commented Apr 30, 2024

@acdha Given that the GitHub Actions pass, what is the status of this PR?

@claudep
Copy link
Contributor

claudep commented Jun 29, 2024

@cclauss In your previous comment, did you mean that this PR could be closed now in your opinion?

@cclauss
Copy link
Contributor

cclauss commented Jun 29, 2024

did you mean that this PR could be closed now in your opinion?

I was asking @acdha that question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants