nova
nova
RRailway
Created by nova on 11/21/2023 in #✋|help
Is there any way to have access to AWS cli within railway?
However, I am now getting the following error:
1/1 replicas never became healthy!

Healthcheck failed!
1/1 replicas never became healthy!

Healthcheck failed!
10 replies
RRailway
Created by nova on 11/21/2023 in #✋|help
Is there any way to have access to AWS cli within railway?
What I ended up doing was configuring a custom railway.toml for the build. For the build command I had it run a custom shell script called railway_setup.sh. This shell script included the running of a python script using the aws boto3 client to retrieve the credentials.
railway.toml
[build]
builder = "nixpacks"
buildCommand = "chmod +x railway_setup.sh && ./railway_setup.sh"

[deploy]
startCommand = "python -m src.api.uvicorn_run --host 0.0.0.0 --port $PORT"
[build]
builder = "nixpacks"
buildCommand = "chmod +x railway_setup.sh && ./railway_setup.sh"

[deploy]
startCommand = "python -m src.api.uvicorn_run --host 0.0.0.0 --port $PORT"
boto3 can automatically make use of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env to authenticate, so there is no need to use the aws client
railway_setup.sh
#!/bin/bash

# Install dependencies from requirements.txt
pip install -r requirements.txt

# Run export_codeartifact.py and capture the output
export CODEARTIFACT_AUTH_TOKEN=$(python export_codeartifact.py)

# Check if the token was retrieved successfully
if [ -z "$CODEARTIFACT_AUTH_TOKEN" ]; then
echo "Failed to retrieve AWS CodeArtifact authorization token."
exit 1
fi

# Use the token to install a package from the CodeArtifact repository
pip install <our private package hosted in aws>
#!/bin/bash

# Install dependencies from requirements.txt
pip install -r requirements.txt

# Run export_codeartifact.py and capture the output
export CODEARTIFACT_AUTH_TOKEN=$(python export_codeartifact.py)

# Check if the token was retrieved successfully
if [ -z "$CODEARTIFACT_AUTH_TOKEN" ]; then
echo "Failed to retrieve AWS CodeArtifact authorization token."
exit 1
fi

# Use the token to install a package from the CodeArtifact repository
pip install <our private package hosted in aws>
export_code_artifact.py
import boto3
import os

AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY')

if (AWS_ACCESS_KEY_ID is None) or (AWS_SECRET_ACCESS_KEY is None):
raise Exception('AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY not found in environment variables.')

# Create a CodeArtifact client
client = boto3.client('codeartifact', region_name='eu-west-2')

# Get the authorization token
response = client.get_authorization_token(
domain='<our domain>',
domainOwner='<our domain owner>'
)

# Extract the authorization token from the response
auth_token = response['authorizationToken']

# Set the token as an environment variable
print(auth_token)
import boto3
import os

AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY')

if (AWS_ACCESS_KEY_ID is None) or (AWS_SECRET_ACCESS_KEY is None):
raise Exception('AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY not found in environment variables.')

# Create a CodeArtifact client
client = boto3.client('codeartifact', region_name='eu-west-2')

# Get the authorization token
response = client.get_authorization_token(
domain='<our domain>',
domainOwner='<our domain owner>'
)

# Extract the authorization token from the response
auth_token = response['authorizationToken']

# Set the token as an environment variable
print(auth_token)
10 replies
RRailway
Created by nova on 11/21/2023 in #✋|help
Is there any way to have access to AWS cli within railway?
No description
10 replies
RRailway
Created by nova on 11/21/2023 in #✋|help
How does a 'self hosted server' actually integrate with railway?
If that's the case, what's that got to do with AWS, GCP and Digital Ocean (as per the docs).
11 replies
RRailway
Created by nova on 11/21/2023 in #✋|help
How does a 'self hosted server' actually integrate with railway?
so from my understanding railway run would be to test that the build/installation and start commands are running fine in a local environment before pushing?
11 replies
RRailway
Created by nova on 11/21/2023 in #✋|help
How does a 'self hosted server' actually integrate with railway?
e4949be4-03c7-44a7-a413-32ffc2e9c2f7
11 replies
RRailway
Created by nova on 6/1/2023 in #✋|help
Cannot read properties of undefined (reading 'map')
e4949be4-03c7-44a7-a413-32ffc2e9c2f7
4 replies
RRailway
Created by nova on 5/30/2023 in #✋|help
How to redeploy services after they were removed due to running out of credits
Clicking rollback looks to have fixed it thanks salute
15 replies
RRailway
Created by nova on 5/30/2023 in #✋|help
How to redeploy services after they were removed due to running out of credits
I'll give it a go thanks salute
15 replies
RRailway
Created by nova on 5/30/2023 in #✋|help
How to redeploy services after they were removed due to running out of credits
15 replies
RRailway
Created by nova on 5/30/2023 in #✋|help
How to redeploy services after they were removed due to running out of credits
no option to redeploy
15 replies
RRailway
Created by nova on 5/30/2023 in #✋|help
How to redeploy services after they were removed due to running out of credits
it only says rollback changes
15 replies
RRailway
Created by nova on 5/30/2023 in #✋|help
How to redeploy services after they were removed due to running out of credits
e4949be4-03c7-44a7-a413-32ffc2e9c2f7
15 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
thanks
49 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
yep - just removed that flag 👍
49 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
thanks a lot 🙂
49 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
will do salute
49 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
I can be thick sometimes but not that thick 😅
49 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
yeah, I'm aware of that. I deployed it with those three requirements first and it worked fine. Then I deployed it with the updated requirements that you sent and it also worked fine (after changing open-cv versions)
49 replies
RRailway
Created by nova on 5/24/2023 in #✋|help
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/b
😅
49 replies