-
Notifications
You must be signed in to change notification settings - Fork 116
Documentation for the Functions Refactor #114
Documentation for the Functions Refactor #114
Conversation
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left new comments. Most of them suggestion, you might need to discuss with Christy before doing them.
--functionId=6012cc93d5a7b ^ | ||
--command="node index.js" ^ | ||
--entrypoint="index.js" ^ | ||
--code="/myrepo/myfunction"</code></pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work anymore.. I think you MUST be in the repository where you are tarring the file, otherwise build will not find files properly. We should try this with new CLI to make sure.
--code="/myrepo/myfunction"</code></pre> | ||
</div> | ||
</li> | ||
<li> | ||
<h3>CMD</h3> | ||
|
||
<div class="ide margin-bottom" data-lang="bash" data-lang-label="CMD"> | ||
<pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite functions createTag ^ | ||
<pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite functions createDeployment ^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add autoDeployment functionality here? It's better to add it and let the developer remove it, than not talking about a feature. Probably applies to all CLI code examples.
<p>The example above shows how you can mount your current working dir into the "appwrite/env-node-15.5:1.0.0" Cloud Functions runtime and execute a custom command to simulate exactly how the Appwrite server will execute the function on the Appwrite server. You can also pass multiple environment variables that your code might require.</p> | ||
|
||
<p>When running a Cloud Functions runtime for a coding language that uses a central directory for managing all dependencies, you will need to package all your dependencies in your working directory under the ".appwrite" folder as mentioned in the "Handling Dependencies" step above. This will ensure your function container can access all required packages and execute your function successfully.</p> | ||
|
||
<h2><a href="/docs/functions#demosExamples" id="demosExamples">Demos & Examples</a></h2> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we mention this repo in the docs? https://github.com/appwrite/functions-starter
If not, should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, It'll be good to mention these for people who are not using the CLI
<p>The example above shows how you can mount your current working dir into the "appwrite/env-node-15.5:1.0.0" Cloud Functions runtime and execute a custom command to simulate exactly how the Appwrite server will execute the function on the Appwrite server. You can also pass multiple environment variables that your code might require.</p> | ||
|
||
<p>When running a Cloud Functions runtime for a coding language that uses a central directory for managing all dependencies, you will need to package all your dependencies in your working directory under the ".appwrite" folder as mentioned in the "Handling Dependencies" step above. This will ensure your function container can access all required packages and execute your function successfully.</p> | ||
|
||
<h2><a href="/docs/functions#demosExamples" id="demosExamples">Demos & Examples</a></h2> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention Appwrite 2.0 CLI? Alongisde manual setup, we could show them appwrite init project
, appwrite init function
and appwrite deploy function
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLI 2.0 does sound like a good thing to mention however will we have a dedicated CLI 2.0 page? If we do we shouldn't go too in-depth about it and only show the commands
<p>The example above shows how you can mount your current working dir into the "appwrite/env-node-15.5:1.0.0" Cloud Functions runtime and execute a custom command to simulate exactly how the Appwrite server will execute the function on the Appwrite server. You can also pass multiple environment variables that your code might require.</p> | ||
|
||
<p>When running a Cloud Functions runtime for a coding language that uses a central directory for managing all dependencies, you will need to package all your dependencies in your working directory under the ".appwrite" folder as mentioned in the "Handling Dependencies" step above. This will ensure your function container can access all required packages and execute your function successfully.</p> | ||
|
||
<h2><a href="/docs/functions#demosExamples" id="demosExamples">Demos & Examples</a></h2> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never mentioned OpenRuntimes. Do we want to? Probably question for @eldadfux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't, not just yet.
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
This PR Contains the Documentation for the upcoming Functions Refactor, these changes explain the new updates to how code should be written for use with appwrite functions.