repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: 'Fly.io' |
| #3 | description: 'Deploy your RAG application to fly.io platform' |
| #4 | --- |
| #5 | |
| #6 | Embedchain has a nice and simple abstraction on top of the [Fly.io](https://fly.io/) tools to let developers deploy RAG application to fly.io platform seamlessly. |
| #7 | |
| #8 | Follow the instructions given below to deploy your first application quickly: |
| #9 | |
| #10 | |
| #11 | ## Step-1: Install flyctl command line |
| #12 | |
| #13 | <CodeGroup> |
| #14 | ```bash OSX |
| #15 | brew install flyctl |
| #16 | ``` |
| #17 | |
| #18 | ```bash Linux |
| #19 | curl -L https://fly.io/install.sh | sh |
| #20 | ``` |
| #21 | |
| #22 | ```bash Windows |
| #23 | pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex" |
| #24 | ``` |
| #25 | </CodeGroup> |
| #26 | |
| #27 | Once you have installed the fly.io cli tool, signup/login to their platform using the following command: |
| #28 | |
| #29 | <CodeGroup> |
| #30 | ```bash Sign up |
| #31 | fly auth signup |
| #32 | ``` |
| #33 | |
| #34 | ```bash Sign in |
| #35 | fly auth login |
| #36 | ``` |
| #37 | </CodeGroup> |
| #38 | |
| #39 | In case you run into issues, refer to official [fly.io docs](https://fly.io/docs/hands-on/install-flyctl/). |
| #40 | |
| #41 | ## Step-2: Create RAG app |
| #42 | |
| #43 | We provide a command line utility called `ec` in embedchain that inherits the template for `fly.io` platform and help you deploy the app. Follow the instructions to create a fly.io app using the template provided: |
| #44 | |
| #45 | ```bash Install embedchain |
| #46 | pip install embedchain |
| #47 | ``` |
| #48 | |
| #49 | ```bash Create application |
| #50 | mkdir my-rag-app |
| #51 | ec create --template=fly.io |
| #52 | ``` |
| #53 | |
| #54 | This will generate a directory structure like this: |
| #55 | |
| #56 | ```bash |
| #57 | ├── Dockerfile |
| #58 | ├── app.py |
| #59 | ├── fly.toml |
| #60 | ├── .env |
| #61 | ├── .env.example |
| #62 | ├── embedchain.json |
| #63 | └── requirements.txt |
| #64 | ``` |
| #65 | |
| #66 | Feel free to edit the files as required. |
| #67 | - `Dockerfile`: Defines the steps to setup the application |
| #68 | - `app.py`: Contains API app code |
| #69 | - `fly.toml`: fly.io config file |
| #70 | - `.env`: Contains environment variables for production |
| #71 | - `.env.example`: Contains dummy environment variables (can ignore this file) |
| #72 | - `embedchain.json`: Contains embedchain specific configuration for deployment (you don't need to configure this) |
| #73 | - `requirements.txt`: Contains python dependencies for your application |
| #74 | |
| #75 | ## Step-3: Test app locally |
| #76 | |
| #77 | You can run the app locally by simply doing: |
| #78 | |
| #79 | ```bash Run locally |
| #80 | pip install -r requirements.txt |
| #81 | ec dev |
| #82 | ``` |
| #83 | |
| #84 | ## Step-4: Deploy to fly.io |
| #85 | |
| #86 | You can deploy to fly.io using the following command: |
| #87 | ```bash Deploy app |
| #88 | ec deploy |
| #89 | ``` |
| #90 | |
| #91 | Once this step finished, it will provide you with the deployment endpoint where you can access the app live. It will look something like this (Swagger docs): |
| #92 | |
| #93 | You can also check the logs, monitor app status etc on their dashboard by running command `fly dashboard`. |
| #94 | |
| #95 | <img src="/images/fly_io.png" /> |
| #96 | |
| #97 | ## Seeking help? |
| #98 | |
| #99 | If you run into issues with deployment, please feel free to reach out to us via any of the following methods: |
| #100 | |
| #101 | <Snippet file="get-help.mdx" /> |
| #102 |