Skip to content

Commit

Permalink
got rid of Dockerfile.prod; Got rid of GH token; env file renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Feb 23, 2024
1 parent 899ef8b commit ab04add
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/start-reindex-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
image_name: ${{ vars.INDEXER_IMAGE_NAME }}
tag: ${{ github.event.inputs.tag }}
dockerfile: umich_catalog_indexing/Dockerfile.prod
dockerfile: umich_catalog_indexing/Dockerfile
docker_context: umich_catalog_indexing/.
secrets: inherit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/start-reindex-workshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
image_name: ${{ vars.INDEXER_IMAGE_NAME }}
tag: ${{ github.event.inputs.tag }}
dockerfile: umich_catalog_indexing/Dockerfile.prod
dockerfile: umich_catalog_indexing/Dockerfile
docker_context: umich_catalog_indexing/.
secrets: inherit

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ jobs:
with:
ruby-version: "3.2"
bundler-cache: true
env:
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{secrets.GH_PACKAGE_READ_TOKEN}}
- name: Create .env file
working-directory: ./umich_catalog_indexing
run: cat .env-dev-values .env-example > .env
run: cat env.* > .env
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,32 @@ Replace values in `umich_catalog_index/.env` with real keys. Ask a developer for

Build it
```
$ docker-compose build
$ docker compose build
```

Build the gems for the web service (the one that has traject)
```
$ docker-compose run --rm web bundle install
$ docker compose run --rm web bundle install
```

Turn it on in detached mode
```
$ docker-compose up -d
$ docker compose up -d
```

In a browser you can look at
http://localhost:8026 for the solr admin panel
http://localhost:8983 for the solr admin panel
http://localhost:9292/ for the sidekiq admin panel

## Trying it Out
Some example commands that should work:
```
docker-compose run --rm web bundle exec irb -r ./lib/sidekiq_jobs.rb
IndexIt.perform_async("search_daily_bibs/birds_2022021017_21131448650006381_new.tar.gz", "http://solr:8983/solr/biblio")
IndexIt.perform_async("search_daily_bibs/birds.tar.gz", "http://solr:8983/solr/biblio")
IndexIt.new.perform("search_daily_bibs/sample.tar.gz", "http://solr:8983/solr/biblio")
IndexHathi.perform_async("zephir_upd_20220301.json.gz", "http://solr:8983/solr/biblio")
```

Expand Down
6 changes: 3 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ services:
- NODB=1
env_file:
- ./umich_catalog_indexing/.env
- ./umich_catalog_indexing/.env-dev-values
- ./mock-ht/.env-dev-values
- ./umich_catalog_indexing/env.development
- ./mock-ht/env.development

redis:
image: 'redis:6.2'
Expand Down Expand Up @@ -97,7 +97,7 @@ services:
volumes:
- ./mock-ht/.:/app
env_file:
- ./mock-ht/.env-dev-values
- ./mock-ht/env.development

#hathifiles:
#image: mariadb
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions umich_catalog_indexing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ FROM development AS production

COPY --chown=${UID}:${GID} . /app

RUN --mount=type=secret,id=gh_package_read_token,uid=1000 \
read_token="$(cat /run/secrets/gh_package_read_token)" \
&& BUNDLE_RUBYGEMS__PKG__GITHUB__COM=${read_token} bundle install
RUN bundle install
36 changes: 0 additions & 36 deletions umich_catalog_indexing/Dockerfile.prod

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit ab04add

Please sign in to comment.