bracket icon indicating copy to clipboard operation
bracket copied to clipboard

Add Docker support for arm64 architecture

Open markusbuecher opened this issue 1 year ago • 4 comments

I would like to run your project at my arm64 server. Unfortunately, your published docker images are build for amd64.

Could you build this for us?

markusbuecher avatar Apr 14 '24 11:04 markusbuecher

I have built the image successfully with docker buildx:

docker buildx build --platform linux/arm64 --load --no-cache --file Dockerfile --tag ghcr.io/evroon/bracket-backend:latest .

docker buildx build --platform linux/arm64 --load --no-cache --file Dockerfile --tag ghcr.io/evroon/bracket-frontend:latest .

I actually get some errors in the Backend Container, which is in a Bootloop: Could you please give me an hint?

Traceback (most recent call last):
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
    worker.init_process()
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/uvicorn/workers.py", line 68, in init_process
    super().init_process()
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/gunicorn/util.py", line 371, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/bracket/app.py", line 12, in <module>
    from bracket.config import Environment, config, environment, init_sentry
  File "/app/bracket/config.py", line 83, in <module>
    config = ProductionConfig()  # type: ignore[call-arg]
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/pydantic_settings/main.py", line 71, in __init__
    super().__init__(
  File "/home/bracket/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.10/site-packages/pydantic/main.py", line 175, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for ProductionConfig
jwt_secret
  Field required [type=missing, input_value={'pg_dsn': 'postgresql://...gres:5432/bracket_prod'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
[2024-04-14 13:52:54 +0000] [8] [INFO] Worker exiting (pid: 8)
[2024-04-14 13:52:55 +0000] [1] [ERROR] Worker (pid:8) exited with code 3
[2024-04-14 13:52:55 +0000] [1] [ERROR] Shutting down: Master
[2024-04-14 13:52:55 +0000] [1] [ERROR] Reason: Worker failed to boot.

markusbuecher avatar Apr 14 '24 14:04 markusbuecher

Ah I would be interested in ARM support, good idea!

You need to pass the JWT_SECRET environment variable to solve this error, you can generate one using openssl rand -hex 32

So maybe:

docker buildx build --platform linux/arm64 --load --no-cache --file Dockerfile -e JWT_SECRET="8dc6af0c3264098037c42b5d1cf1a4f1360e8a3e7dfa5dc599cf9605212c4a38" --tag ghcr.io/evroon/bracket-backend:latest .

But I don't have experience with this docker buildx thing

evroon avatar Apr 17 '24 11:04 evroon

I have added the generated JWT Secret to the Docker Compose File and started the backend successfully. Actually I cant login with the credentials which I added there also. image

markusbuecher avatar Apr 17 '24 15:04 markusbuecher

image

markusbuecher avatar Apr 17 '24 16:04 markusbuecher

This issue is stale because it has been open for 60 days with no activity. What is the action to take here?

github-actions[bot] avatar Jul 06 '24 08:07 github-actions[bot]