SHxKM
SHxKM
RRailway
Created by SHxKM on 2/7/2024 in #✋|help
Usage Alerts Clarification
No description
23 replies
RRailway
Created by SHxKM on 2/1/2024 in #✋|help
Render Error on new deployment
On a new deployment, there's always a brief period of time (5-25 seconds) where the website intermittently returns an error with Railway theme and some generic error text (I forget what it is). Is that behavior expected?
175 replies
RRailway
Created by SHxKM on 1/30/2024 in #✋|help
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
I'm getting this error while trying to cache downloading a somewhat challenging to cache pip package:
RUN \
--mount=type=cache,target=/var/cache/apt \
pip3 download https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1.tar.gz
RUN \
--mount=type=cache,target=/var/cache/apt \
pip3 download https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1.tar.gz
This runs file locally and the package isn't redownloaded, but it fails on Railway with:
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
Why is id mandatory, and why is it missing the target field?
17 replies
RRailway
Created by SHxKM on 1/29/2024 in #✋|help
Where should I run my Django migrations (Dockerfile)
So I’ve successfully deployed two services to Railway this weekend. I’m using compose for local development but since Railway doesn’t support that I deployed using the Dockerfile, overriding the ENTRYPOINT for one of the services. One thing I don’t particularly like about my setup is that Django DB migrations are being run in the ENTRYPOINT code, which ties this operation to the container’s boot. Ideally this should be some kind of pre/post hook. Do I have other options?
7 replies
RRailway
Created by SHxKM on 1/28/2024 in #✋|help
How to override Dockerfile Start CMD/Entrypoint "in exec form"?
I guess this more about me not understanding what "exec form" exactly is (despite reading the docs). Can anyone give an example how would I override in a way that complies with how Railway works:
the start command overrides the Docker image's ENTRYPOINT in exec form
the start command overrides the Docker image's ENTRYPOINT in exec form
Let's say my default CMD is:
CMD ["gunicorn", "-c", "python:config.gunicorn", "config.wsgi"]
CMD ["gunicorn", "-c", "python:config.gunicorn", "config.wsgi"]
And the same Dockerfile has:
ENTRYPOINT ["/app/bin/docker-entrypoint-web"]
ENTRYPOINT ["/app/bin/docker-entrypoint-web"]
How do I change it to CMD:
CMD ["python", "manage.py", "someothercommand"]
CMD ["python", "manage.py", "someothercommand"]
39 replies
RRailway
Created by SHxKM on 1/27/2024 in #✋|help
Am I doing something wrong with custom domains? (Namecheap)
No description
36 replies
RRailway
Created by SHxKM on 1/27/2024 in #✋|help
Running one off commands in Docker container
Super weird to me that Railway doesn't support simply SSHing into a VM. Anyway, I'm deploying a Django project. In Django there's something called management commands and it's imperative for me to be able to use it. Locally, I do it with:
python manage.py [command] [args]
python manage.py [command] [args]
But since I'm using a containerized environment, I do it like this:
./run manage [command] [args]
./run manage [command] [args]
I thought I can do the same remotely with railway link. When I do:
railway run ./run manage [command] [args]
railway run ./run manage [command] [args]
The command seemingly runs successfully. But I know it didn't run on the railway production instance because it's supposed to populate DB rows, and nothing like that happened in the Railway environment. Am I out of luck?
138 replies
RRailway
Created by SHxKM on 1/27/2024 in #✋|help
Docker image deployment fail, nothing in logs
No description
15 replies
RRailway
Created by SHxKM on 4/14/2023 in #✋|help
dependencies re-installed on every build
Django (Python) app . Railway is installing my dependencies on every build, even though no changes are made to requirements.txt. Project ID: fc77f02c-13c9-45e5-8d2f-d6c3dfc9188d I see this in the build logs:
#12 54.00 Using legacy 'setup.py install' for tornado, since package 'wheel' is not installed.
[......GOES ON FOR EVERY PACKAGE.......]

#12 55.25 Installing collected packages: zstandard, [.......GOES ON FOR EVERY PACKAGE.........]

#12 55.25 Running setup.py install for zstandard: started

#12 96.85 Running setup.py install for zstandard: finished with status 'done'

#12 96.86 Running setup.py install for wrapt: started

#12 97.88 Running setup.py install for wrapt: finished with status 'done'

#12 98.23 Running setup.py install for rjsmin: started
#12 54.00 Using legacy 'setup.py install' for tornado, since package 'wheel' is not installed.
[......GOES ON FOR EVERY PACKAGE.......]

#12 55.25 Installing collected packages: zstandard, [.......GOES ON FOR EVERY PACKAGE.........]

#12 55.25 Running setup.py install for zstandard: started

#12 96.85 Running setup.py install for zstandard: finished with status 'done'

#12 96.86 Running setup.py install for wrapt: started

#12 97.88 Running setup.py install for wrapt: finished with status 'done'

#12 98.23 Running setup.py install for rjsmin: started
My nixpacks.toml:
providers = ["python"]

[phases.setup]
> aptPkgs = ["libcurl4-openssl-dev", "libssl-dev", "libmemcached-dev", "libpq-dev", "python3-dev", "gcc", "g++", "libpq5", "python3-psycopg2"]
nixPkgs = ["postgresql_13", "python39", "libmemcached"]

[phases.build]
cmds = ["find / -name libpq.so.5 && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nix/store/redacted-postgresql-13.9-lib/lib/libpq.so.5"]


[start]
cmd = "ln -s /nix/store/redacted-postgresql-13.9-lib/lib/libpq.so.5 /usr/lib/libpq.so.5 && ln -s /nix/store/redacted-postgresql-13.9-lib/lib/libpq.so.5 /usr/lib64/libpq.so.5 && celery -A my_proj worker -c 6 -Q background -l info --workdir . -Ofair -n railwaybackgroundworker@%h"
providers = ["python"]

[phases.setup]
> aptPkgs = ["libcurl4-openssl-dev", "libssl-dev", "libmemcached-dev", "libpq-dev", "python3-dev", "gcc", "g++", "libpq5", "python3-psycopg2"]
nixPkgs = ["postgresql_13", "python39", "libmemcached"]

[phases.build]
cmds = ["find / -name libpq.so.5 && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nix/store/redacted-postgresql-13.9-lib/lib/libpq.so.5"]


[start]
cmd = "ln -s /nix/store/redacted-postgresql-13.9-lib/lib/libpq.so.5 /usr/lib/libpq.so.5 && ln -s /nix/store/redacted-postgresql-13.9-lib/lib/libpq.so.5 /usr/lib64/libpq.so.5 && celery -A my_proj worker -c 6 -Q background -l info --workdir . -Ofair -n railwaybackgroundworker@%h"
Builds are taking > 10 mins.
9 replies
RRailway
Created by SHxKM on 4/14/2023 in #✋|help
Builds failing without any logs or reason after adding custom step and removing it
fc77f02c-13c9-45e5-8d2f-d6c3dfc9188d I added a step that relies on phases.setup, and after things didn't work as expected removed it, now it's failing without any build or deploy logs. Very unreliable experience.
3 replies
RRailway
Created by SHxKM on 4/14/2023 in #✋|help
How do I tell Railway not to re-install dependencies if requirements.txt didn't change?
My app has some heavy pip packages and some of them take long to install, how can I tell Railway to skip this installation step if requirements.txt didn't change?
3 replies