Railway ignore and HLS .ts files

For my Adonisjs Typescript app I'm working with video files that are transcoded into HLS, as part of the transcoding process from .mp4, .mov, etc into HLS, the output is .m3u8 playlist files, which are text file manifests containing links to the other playlist and video files and .ts files which are segments of the transcoded video. For testing purposes I have an already transcoded video saved in my Repo so that I can bypass the transcoding process when testing other parts of my app, but this is causing build errors in Railway, I'm assuming it's because the build process is attempting to parse the .ts files with a type of MPEG transport stream data and treating those as Typescript files. I have those files in a tests/assets/ directory in my repo. I've seen mention of a .railwayignore file and found the "Configure Watch Paths" option, but that looks like it only controls what files to watch for changes when running builds. I was hoping to find a way to have Railway ignore the tests/ directory altogether in the build process but wasn't sure if that's possible.
21 Replies
Percy
Percy3d ago
Please provide your project ID or reply with N/A. Thread will automatically be closed if no reply is received within 10 minutes. You can copy your project's id by pressing Ctrl/Cmd + K -> Copy Project ID.
Brody
Brody3d ago
could you use .dockerignore?
Percy
Percy3d ago
No project ID was provided. Closing thread.
El Queso Bandito
El Queso BanditoOP3d ago
I tried that, looks like it still tries to read those files as UTF-8 722dccb2-d05a-4099-b21f-f525bef38d3c
Brody
Brody3d ago
have you tried a .railwayignore?
El Queso Bandito
El Queso BanditoOP3d ago
Just tried creating a .railwayignore file too with the same contents
tests/assets/video_versions/**
tests/assets/video_versions/f9732fd3-605c-4bf3-ab6a-d523e59ab4bf/hls/f9732fd3-605c-4bf3-ab6a-d523e59ab4bf_1080p_3Mbps_00001.ts
tests/assets/video_versions/**
tests/assets/video_versions/f9732fd3-605c-4bf3-ab6a-d523e59ab4bf/hls/f9732fd3-605c-4bf3-ab6a-d523e59ab4bf_1080p_3Mbps_00001.ts
and same issue there, looks like the files are still being viewed as part of the source code in build Since those aren't needed in production I can just make some work around fix in testing only to grab them, was just hoping there was a simple fix
Brody
Brody3d ago
then you can run railway up from a GitHub action then it will respect .railwayignore
El Queso Bandito
El Queso BanditoOP3d ago
Sounds good, I'll dig into that a little more I did have a question about connecting to the Redis instance in my Adonisjs app, it seems the app can't connect to the redis.railway.internal host, are you able to take a look at that or should I start a new thread?
Brody
Brody3d ago
ioredis?
El Queso Bandito
El Queso BanditoOP3d ago
AdonisJS so using their Redis package https://docs.adonisjs.com/guides/database/redis
Redis
Use Redis inside your AdonisJS applications using the @adonisjs/redis package.
Brody
Brody3d ago
does it use ioredis?
El Queso Bandito
El Queso BanditoOP3d ago
Yes, it looks like ioredis is listed as a dependency https://github.com/adonisjs/redis/blob/develop/package.json
GitHub
redis/package.json at develop · adonisjs/redis
Package for working with Redis in AdonisJS. Contribute to adonisjs/redis development by creating an account on GitHub.
El Queso Bandito
El Queso BanditoOP3d ago
Interesting, looks like switching to the public URL worked so I'll troubleshoot more getting the internal networking to work
Brody
Brody3d ago
have you checked out the link I sent?
El Queso Bandito
El Queso BanditoOP3d ago
I did, I'm not sure exactly how the adonisjs/redis package is using the ioredis connection under the hood though so I need to dig into that to figure out how to get the connection to work
Brody
Brody3d ago
no need to overthink it, just set family to 0 either in the url or the config options.
El Queso Bandito
El Queso BanditoOP3d ago
fingers crossed, but looks like adding it after the PORT env variable worked 6379?family=0 wait, I lied actually, that doesn't work
Brody
Brody3d ago
please send a link to the service that is showing these errors
El Queso Bandito
El Queso BanditoOP3d ago
okay, finally figured it out it's not documented in the adonisjs/redis docs but there is a config variable for family.
import env from '#start/env'
import { defineConfig } from '@adonisjs/redis'
import { InferConnections } from '@adonisjs/redis/types'

const redisConfig = defineConfig({
connection: 'main',

connections: {
/*
|--------------------------------------------------------------------------
| The default connection
|--------------------------------------------------------------------------
|
| The main connection you want to use to execute redis commands. The same
| connection will be used by the session provider, if you rely on the
| redis driver.
|
*/
main: {
host: env.get('REDIS_HOST'),
port: env.get('REDIS_PORT'),
password: env.get('REDIS_PASSWORD', ''),
db: 0,
family: 0,
keyPrefix: '',
retryStrategy(times) {
return times > 10 ? null : times * 50
},
},
},
})

export default redisConfig

declare module '@adonisjs/redis/types' {
export interface RedisConnections extends InferConnections<typeof redisConfig> {}
}
import env from '#start/env'
import { defineConfig } from '@adonisjs/redis'
import { InferConnections } from '@adonisjs/redis/types'

const redisConfig = defineConfig({
connection: 'main',

connections: {
/*
|--------------------------------------------------------------------------
| The default connection
|--------------------------------------------------------------------------
|
| The main connection you want to use to execute redis commands. The same
| connection will be used by the session provider, if you rely on the
| redis driver.
|
*/
main: {
host: env.get('REDIS_HOST'),
port: env.get('REDIS_PORT'),
password: env.get('REDIS_PASSWORD', ''),
db: 0,
family: 0,
keyPrefix: '',
retryStrategy(times) {
return times > 10 ? null : times * 50
},
},
},
})

export default redisConfig

declare module '@adonisjs/redis/types' {
export interface RedisConnections extends InferConnections<typeof redisConfig> {}
}
thanks for the help pointing to the ioredis family connection thing
Brody
Brody3d ago
no problem!
Want results from more Discord servers?
Add your server