Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: setup and deploy to FLY GPU #24

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/fly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy NEW_MEDIA to Fly

on:
push:
branches:
- main
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v3

- name: Deploy to Fly.io
uses: superfly/[email protected]
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
with:
args: "deploy --remote-only --dockerfile ./Dockerfile.prod --config ./fly.toml"


3 changes: 2 additions & 1 deletion demo/components/WebSocketExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export interface ServerWSResponse {
}

export default function WebSocketExample({port = 8080}:{port?:number}){
const server_ws_url = process.env.NODE_ENV === "production" ? `ws://localhost:${port}` : "ws://new-media.fly.dev"
const [imgMetadata, setImageMetadata] = useState<ServerWSResponse>();
const [socket, setSocket] = useState<WebSocket>()

useEffect(() => {
const socket = new WebSocket(`ws://localhost:${port}`)
const socket = new WebSocket(server_ws_url)

socket.onopen = () => {
setSocket(socket)
Expand Down
6 changes: 3 additions & 3 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app = 'new-media-still-surf-1038'
primary_region = 'sjc'
app = 'new-media'
primary_region = 'ord'

[build]
dockerfile = 'Dockerfile.prod'
Expand All @@ -16,4 +16,4 @@ primary_region = 'sjc'
cpu_kind = 'performance'
memory = '64gb'
cpus = 16
size = "a100-40gb"
size = "a100-40gb"
Loading