Skip to content

Commit

Permalink
[ENG-6197] Update Docker Compose files to run ES6 on ARM (#10728)
Browse files Browse the repository at this point in the history
* fix thanks to MC, add working docker image
* use envvars consistently
* clean-up README.md

---------

Co-authored-by: John Tordoff <>
  • Loading branch information
Johnetordoff authored Sep 2, 2024
1 parent a2aa164 commit 2d458e9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 56 deletions.
20 changes: 5 additions & 15 deletions README-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@

#### Special Instructions for Apple Chipset (M1, M2, etc.) and other ARM64 architecture

* _NOTE: The `elasticsearch`, `elasticsearch6`, and `sharejs` containers are incompatible with ARM64._
* _NOTE: The default `elasticsearch`, `elasticsearch6`, and `sharejs` containers are incompatible with ARM64._

- To run `elasticsearch6` on ARM64 architecture:

- Copy `docker-compose-dist-arm64.override.yml` into your `docker-compose.override.yml` file

- Running containers with docker compose

Expand All @@ -120,20 +124,6 @@
SEARCH_ENGINE = None
```

- Building the Docker image

- If you wish to use an OSF image other than the latest `develop-arm64`:
- Build the image
```bash
cd <path-to-osf.io>
git checkout <master|develop|etc>
docker buildx build --platform linux/arm64 -t osf:<branch>-arm64 .
```
- In `docker-compose.override.yml`, replace any `quay.io/centerforopenscience/osf:develop-arm64` with the locally-tagged image above:
```yml
image: osf:<branch>-arm64
```

## Application Runtime

* _NOTE: Running docker containers detached (`-d`) will execute them in the background, if you would like to view/follow their console log output use the following command._
Expand Down
2 changes: 1 addition & 1 deletion api/base/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
# django-elasticsearch-metrics
ELASTICSEARCH_DSL = {
'default': {
'hosts': os.environ.get('ELASTIC6_URI', '127.0.0.1:9201'),
'hosts': osf_settings.ELASTIC6_URI,
'retry_on_timeout': True,
},
}
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _test_speedups_disable(request, settings, _test_speedups):

@pytest.fixture(scope='session')
def setup_connections():
connections.create_connection(hosts=['http://localhost:9201'])
connections.create_connection(hosts=[website_settings.ELASTIC6_URI])


@pytest.fixture(scope='function')
Expand Down
41 changes: 2 additions & 39 deletions docker-compose-dist-arm64.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,6 @@ services:
# OSF #
#######

requirements:
image: quay.io/centerforopenscience/osf:develop-arm64
elasticsearch6:
image: quay.io/centerforopenscience/elasticsearch:es6-arm-6.3.1
platform: linux/arm64

assets:
image: quay.io/centerforopenscience/osf:develop-arm64
platform: linux/arm64
# Need to allocate tty to be able to call invoke for requirements task
tty: true

admin_assets:
image: quay.io/centerforopenscience/osf:develop-arm64
platform: linux/arm64
# Need to allocate tty to be able to call invoke for requirements task
tty: true

worker:
image: quay.io/centerforopenscience/osf:develop-arm64
platform: linux/arm64
# Need to allocate tty to be able to call invoke for requirements task
tty: true

admin:
image: quay.io/centerforopenscience/osf:develop-arm64
platform: linux/arm64
# Need to allocate tty to be able to call invoke for requirements task
tty: true

api:
image: quay.io/centerforopenscience/osf:develop-arm64
platform: linux/arm64
# Need to allocate tty to be able to call invoke for requirements task
tty: true

web:
image: quay.io/centerforopenscience/osf:develop-arm64
platform: linux/arm64
# Need to allocate tty to be able to call invoke for requirements task
tty: true

1 change: 1 addition & 0 deletions website/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def parent_dir(path):

SEARCH_ENGINE = 'elastic' # Can be 'elastic', or None
ELASTIC_URI = '127.0.0.1:9200'
ELASTIC6_URI = os.environ.get('ELASTIC6_URI', '127.0.0.1:9201')
ELASTIC_TIMEOUT = 10
ELASTIC_INDEX = 'website'
ELASTIC_KWARGS = {
Expand Down

0 comments on commit 2d458e9

Please sign in to comment.