-
Notifications
You must be signed in to change notification settings - Fork 64
Fn Contexts Docs Project
Michael J Williams edited this page Nov 7, 2019
·
1 revision
This is a project to document how contexts work with Fn both from the CLI perspective and from the function perspective.The content should be divided into several files. Those will be identified along with their repos in the outlines below. These docs will be part of a series.
Initial setup of your context is covered in the installation tutorial: https://github.com/fnproject/tutorials/blob/master/install/README.md#configure-your-context
A general how-to on using contexts to connect to different servers.
- Create your own custom context for Fn
- Deploy a function with your context using
fndemouser
and--local
to your Fn server. - Deploy a function with your context using your GitHub account to your Fn server.
- Review the Docker commands needed to see where your Docker image and containers are stored.
- Explain the difference between an image and a container
- Setup an Fn Server on another machine
- Create a new context for that machine
- Deploy a function with your context using your GitHub account to an Fn server on a different machine.
- Create your own context from scratch
- Use the command line tool
fn create context
- Go over what each parameter means
- Show where your file is created
- Show what is in the file that is created
- Look at the default.yaml file
- Use the command line tool
- Create a Hello World function (use Python or Node for simplicity).
- Deploy the function locally. (--local)
- Demonstrate what has has happended with Docker
- Show the image that is created in Docker
- Show the container that is created in Docker
- (Test to see if this works) Remove fndemouser and deploy locally.
- Is the image deployed to DockerHub and then to Fn?
- (Comment: I think the default behavior is to deploy to DockerHub using your default Docker information. We need to test this.)
- Show where the image is stored.
- Set your registry to your DockerHub account.
- Deploy to your server using your DockerHub account.
- Show where the image ends up with screen shots.
- Show that it is the same as the previous step.
- Show any pertinent Docker commands.
- Setup a server on another machine
- Setup a context for that new machine
- Try just copying the file this time rather than using the CLI.
- Deploy helloworld to the new server using your GitHub image and Fn server running on another machine.
- What is the purpose of
api
in a context yaml file?
A how-to on creating and using context variables. Create one sample in Java and one in Node or Python.
- Create context variables and access them in a function.
- Demo code to access context data in a function.
- Show what other information is available in context.
- Applications vars
- Function vars
- Add several variables to a context
- Create a sample program which prints out the context variables.
- Explain how to setup context object
- Explain how to access vars
- Deploy and demo sample
- Provide a list of autogenerated Env vars
- Show how to access them from context object
- Deploy and test sample
- Access application and function vars from the context
- Setup an app and function var
- Show how to read them from the context object.
- Deploy and test sample
- Should we show how to access HTTP headers?
- Is there anything else we should demo that is in context object?