Back

Steps for Creating a Function w/ Runtime Not Supported by Cloud

  • 0
  • Self Hosted
  • Functions
Kilo Loco
7 Feb, 2024, 02:23

tl;dr How can I launch a Swift function on Appwrite?

I'm currently trying to launch a function in a runtime that is not supported by Appwrite Cloud at the moment (Swift) but can't seem to figure it out. I also can't find docs that show the complete flow.

What I've done so far

  1. Setup Appwrite locally w/ Docker
  2. Created an account via localhost
  3. Created a project
  4. Logged in via CLI
  5. Linked directory with project
  6. Ran appwrite functions create --functionId 'tryfunctions' --name firstFunction --runtime 'swift-5.8'

This is the error I receive:

TypeScript
Error Invalid `runtime` param: Value must be one of (node-16.0, php-8.0, ruby-3.0, python-3.9)

I understand that Appwrite Cloud only supports those runtimes as listed in the docs here: https://appwrite.io/docs/products/functions/runtimes but those same docs list Swift as a supported language.

I've also looked under the Development docs https://appwrite.io/docs/products/functions/development but still couldn't figure out how the Swift (or an other alternatative) runtime fits into the flow and how the intial function is generated, if at all.

If existing docs exist, or any other resources, I'd grately appreciate the help.

p.s. if the resources don't exist, I will create them this week

TL;DR
I'm trying to create a Swift function in Appwrite, but it seems that Swift is not supported by Appwrite Cloud. I've already set up Appwrite locally and followed the necessary steps. The error message I receive states that the Swift runtime is invalid. The official Appwrite documentation lists Swift as a supported language, but I couldn't find any information on how to use Swift in the development flow. If anyone has any resources or information on this issue, I would greatly appreciate it. Solution: To add a runtime that is not supported by Appwrite Cloud, update the `.env` file in the `appwrite` directory on
Steven
7 Feb, 2024, 02:25
Kilo Loco
7 Feb, 2024, 02:26

perfect! Let me try that. I obviously didnt look closely enough at the docs

Kilo Loco
7 Feb, 2024, 02:26

Thanks Steven

Kilo Loco
7 Feb, 2024, 02:48

For anyone viewing this thread, you can add a runtime that isn't supported by Cloud by updating the .env file in the appwrite directory on your machine (it should be located in the directory wherever you downloaded the Appwrite CLI). Once located, update the runtimes variable with the runtime(s) you're interested in using. Here's an example of what mine looks like:

TypeScript
_APP_FUNCTIONS_RUNTIMES=swift-5.8

You can find a list of runtime names in the doc I referenced in the original post.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more