You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because nix is used to build the container image, it's not easy to run alembic.
For 0.9.1, the alembic binary happens to be at /nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/alembic. Seems like we need to set this as an --entrypoint to invoke it.
It appears that we also need to pass a config to it, which happens to live at /nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/alembic.ini.
Looks like we also need to run the alembic command with a working directory like /nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration (passed to docker run via -w).
Traceback (most recent call last):
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/.alembic-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/config.py", line 577, in main
CommandLine(prog=prog).main(argv=argv)
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/config.py", line 571, in main
self.run_cmd(cfg, options)
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/config.py", line 548, in run_cmd
fn(
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
script.run_env()
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
util.load_python_file(self.dir, "env.py")
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
module = load_module_py(module_id, path)
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "alembic/env.py", line 14, in <module>
from matrix_registration import config as mr_config
ModuleNotFoundError: No module named 'matrix_registration
So I'm guessing the command above needs even more work.
Is it possible to adjust the container-building script, so that it puts binaries (or symlinks to them) at a predictable path?
What would be the proper way to invoke alembic from a container image?
if I put both configured like that on the PATH I could just use a default entrypoint.
then I guess you would have to write out the entire command. as in matrix-registration serve or alembic upgrade head instead of just serve, but overwriting the entrypoint for alembic seems kinda bad?
I'm not sure I understand what the above nix configuration does, but anyway.. writing out the entire command sounds (matrix-registration serve, instead of just serve) sounds good.
Because nix is used to build the container image, it's not easy to run alembic.
For
0.9.1
, thealembic
binary happens to be at/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/alembic
. Seems like we need to set this as an--entrypoint
to invoke it.It appears that we also need to pass a config to it, which happens to live at
/nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/alembic.ini
.Looks like we also need to run the
alembic
command with a working directory like/nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration
(passed todocker run
via-w
).In the end, I've gotten to a command like this:
Yet I still get some error like this:
So I'm guessing the command above needs even more work.
Is it possible to adjust the container-building script, so that it puts binaries (or symlinks to them) at a predictable path?
What would be the proper way to invoke
alembic
from a container image?Related to spantaleev/matrix-docker-ansible-deploy#1208
The text was updated successfully, but these errors were encountered: