diff --git a/404.html b/404.html index f12a2ca..35e4217 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Skills Network Knowledge Base - + diff --git a/assets/images/app-overview-example-392dbd467597c265e8409f731b564f34.png b/assets/images/app-overview-example-392dbd467597c265e8409f731b564f34.png new file mode 100644 index 0000000..d09379a Binary files /dev/null and b/assets/images/app-overview-example-392dbd467597c265e8409f731b564f34.png differ diff --git a/assets/images/short-course-example-7043b9c721fe72a06530daaa42c3f987.png b/assets/images/short-course-example-7043b9c721fe72a06530daaa42c3f987.png new file mode 100644 index 0000000..9b83256 Binary files /dev/null and b/assets/images/short-course-example-7043b9c721fe72a06530daaa42c3f987.png differ diff --git a/assets/images/tips-for-best-experience-5141f4d27498a9ce2a6dc8bc9ac964ec.png b/assets/images/tips-for-best-experience-5141f4d27498a9ce2a6dc8bc9ac964ec.png new file mode 100644 index 0000000..f0b1be4 Binary files /dev/null and b/assets/images/tips-for-best-experience-5141f4d27498a9ce2a6dc8bc9ac964ec.png differ diff --git a/assets/js/65bcfc64.21d0a15b.js b/assets/js/65bcfc64.21d0a15b.js deleted file mode 100644 index f34a49f..0000000 --- a/assets/js/65bcfc64.21d0a15b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkauthor_workbench_knowledgebase=self.webpackChunkauthor_workbench_knowledgebase||[]).push([[314],{8335:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"labs/tools/cloud-ide","title":"Cloud IDE","description":"Cloud IDE is a browser integrated development environment running in the cloud. It supports many programming languages and tools right out of the box so that the users can start working right away without the hassle of tedious setups.","source":"@site/docs/labs/tools/cloud-ide.md","sourceDirName":"labs/tools","slug":"/labs/tools/cloud-ide","permalink":"/docs/labs/tools/cloud-ide","draft":false,"unlisted":false,"editUrl":"https://github.com/ibm-skills-network/author-workbench-knowledgebase/tree/master/docs/labs/tools/cloud-ide.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Introduction","permalink":"/docs/labs/tools/introduction"},"next":{"title":"JupyterLab","permalink":"/docs/labs/tools/jupyterlab"}}');var t=o(4848),s=o(8453);const r={},a="Cloud IDE",l={},d=[{value:"Launch a terminal",id:"launch-a-terminal",level:2},{value:"Docker",id:"docker",level:2},{value:"Volume Mount Points",id:"volume-mount-points",level:3},{value:"Kubernetes",id:"kubernetes",level:2},{value:"Embeddable AI",id:"embeddable-ai",level:2},{value:"Using the provided Services",id:"using-the-provided-services",level:3},{value:"Building and Deploying to Code Engine",id:"building-and-deploying-to-code-engine",level:3},{value:"1. Create Code Engine Project",id:"1-create-code-engine-project",level:5},{value:"2. Click on Code Engine CLI Button",id:"2-click-on-code-engine-cli-button",level:5},{value:"3. Choose and deploy your desired Embeddable AI image",id:"3-choose-and-deploy-your-desired-embeddable-ai-image",level:5},{value:"Prerequisites:",id:"prerequisites",level:5},{value:"1. Log in to your IBM Cloud account",id:"1-log-in-to-your-ibm-cloud-account",level:5},{value:"2. Login to the IBM Entitled Registry",id:"2-login-to-the-ibm-entitled-registry",level:5},{value:"3. Choose and build your desired Embeddable AI image",id:"3-choose-and-build-your-desired-embeddable-ai-image",level:5},{value:"4 Create a namespace and log in to ICR",id:"4-create-a-namespace-and-log-in-to-icr",level:5},{value:"6. Push your image to your namespace",id:"6-push-your-image-to-your-namespace",level:5},{value:"7. Deploy the image to Code Engine",id:"7-deploy-the-image-to-code-engine",level:5},{value:"Americas",id:"americas",level:4},{value:"Europe",id:"europe",level:4},{value:"Asia Pacific",id:"asia-pacific",level:4},{value:"Framework-Specific Infomation",id:"framework-specific-infomation",level:2},{value:"Flutter Web and Cloud IDE",id:"flutter-web-and-cloud-ide",level:3}];function c(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",header:"header",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components},{Details:i}=n;return i||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"cloud-ide",children:"Cloud IDE"})}),"\n",(0,t.jsx)(n.p,{children:"Cloud IDE is a browser integrated development environment running in the cloud. It supports many programming languages and tools right out of the box so that the users can start working right away without the hassle of tedious setups.\nUser interface of Cloud IDE, as shown below, comprises of course instructions on the left side and vscode-like development environment on the right side."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Cloud IDE Screenshot",src:o(3939).A+"",width:"2551",height:"1567"})}),"\n",(0,t.jsx)(n.h2,{id:"launch-a-terminal",children:"Launch a terminal"}),"\n",(0,t.jsxs)(n.p,{children:["Click ",(0,t.jsx)(n.code,{children:"Terminal"})," in the menu of the development environment(on the right side of the screen). Then from the dropdown select ",(0,t.jsx)(n.code,{children:"New Terminal"})," and it should open up a new terminal for you."]}),"\n",(0,t.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,t.jsxs)(n.p,{children:["Docker is an open source platform that is widely used to develop, ship and run applications. Cloud-IDE has built-in support for Docker. You can simply use ",(0,t.jsx)(n.code,{children:"docker"})," cli to run commands. Internally, the docker client(in your IDE) talks to docker daemon, running on a remote host, over a TCP connection. Default user(theia) is configured to run docker commands. Docker commands don't require root privileges. So, don't preface commands with ",(0,t.jsx)(n.code,{children:"sudo"})," or run them with root user. Some examples are:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"docker version\n"})}),"\n",(0,t.jsx)(n.p,{children:"It prints information about the docker client and engine."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"docker container list\n"})}),"\n",(0,t.jsx)(n.p,{children:"It lists the existing containers."}),"\n",(0,t.jsx)(n.h3,{id:"volume-mount-points",children:"Volume Mount Points"}),"\n",(0,t.jsxs)(n.p,{children:["Volume is mounted to persist data from a docker container. Currently, Cloud-IDE only allows mounting data from ",(0,t.jsx)(n.code,{children:"/home/project"})," directory. For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"docker run -itd --name my-first-container -v /home/project/testDir:/app ubuntu:latest\n"})}),"\n",(0,t.jsxs)(n.p,{children:["It spins up ",(0,t.jsx)(n.code,{children:"my-first-container"})," using ",(0,t.jsx)(n.code,{children:"ubuntu:latest"})," image and mounts ",(0,t.jsx)(n.code,{children:"/home/project/testDir"}),"(if it exists in your environment) to the ",(0,t.jsx)(n.code,{children:"/app"})," directory inside the container."]}),"\n",(0,t.jsxs)(n.p,{children:["See the docker ",(0,t.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/docker/",children:"documentation"})," for more commands."]}),"\n",(0,t.jsx)(n.h2,{id:"kubernetes",children:"Kubernetes"}),"\n",(0,t.jsxs)(n.p,{children:["Kubernetes is an open source container orchestrator which allows to schedule docker containers on large scale compute nodes. It is now a de-facto standard for cloud-native application development and deployment. Cloud-IDE is already configured to support Kubernetes. It has a pre-installed command line tool called ",(0,t.jsx)(n.code,{children:"kubectl"})," that handles communication with remote kubernetes cluster. Here are a few examples:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"kubectl run my-first-pod --restart=Never --image=ubuntu -- sleep 10s\n"})}),"\n",(0,t.jsxs)(n.p,{children:["It creates a ",(0,t.jsx)(n.code,{children:"my-first-pod"})," that runs a container using ",(0,t.jsx)(n.code,{children:"ubuntu"})," image with ",(0,t.jsx)(n.code,{children:"sleep 10s"})," command. This container spawns ",(0,t.jsx)(n.code,{children:"sleep 10s"})," process."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"kubectl get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"It prints existing pods in your namespace."}),"\n",(0,t.jsxs)(n.p,{children:["More commands can be found in the Kubernetes ",(0,t.jsx)(n.a,{href:"https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands",children:"documentation"})]}),"\n",(0,t.jsx)(n.h2,{id:"embeddable-ai",children:"Embeddable AI"}),"\n",(0,t.jsxs)(n.p,{children:["Cloud IDE supports various Embeddable AI services includes Text-To-Speech, Speech-To-Text, and various Watson NLP services (e.g. sentiment, emotion, etc.). Learners have immediate access to all of these services (via HTTP API calls) to learn, test, and embed in their applications. Moreover, Skills Network provides images for all of these services so learners can ",(0,t.jsx)(n.em,{children:"deploy"})," the services to the provided Code Engine Project, alongisde their applcations."]}),"\n",(0,t.jsx)(n.h3,{id:"using-the-provided-services",children:"Using the provided Services"}),"\n",(0,t.jsxs)(n.p,{children:["All of the services are available to all Cloud IDE learners, for all flavours of Cloud IDE. For example the Text-To-Speech can be accessed at: ",(0,t.jsx)(n.a,{href:"https://sn-watson-tts.labs.skills.network",children:"https://sn-watson-tts.labs.skills.network"}),". To help learners both know what services are available and how to use them the Skills Network Toolbox provides a page for each of the Embeddable AI services which shows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Name and brief description"}),"\n",(0,t.jsx)(n.li,{children:"Available Models"}),"\n",(0,t.jsx)(n.li,{children:"Link to Documentation"}),"\n",(0,t.jsx)(n.li,{children:"Example Commands (with button to easily copy or run in terminal)"}),"\n"]}),"\n",(0,t.jsxs)(i,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)("b",{children:(0,t.jsx)("u",{children:"View Screenshot"})})}),(0,t.jsx)("img",{width:"422",alt:"image",src:"https://user-images.githubusercontent.com/276912/215758158-2c8022b5-7d03-454e-a0bf-ed75e0d08d7d.png"})]}),"\n",(0,t.jsx)(n.p,{children:"Moreover, as an author, within Author IDE, you can add Buttons to your lab's markdown instructions to help learners open these pages with a simple button click."}),"\n",(0,t.jsx)(n.h3,{id:"building-and-deploying-to-code-engine",children:"Building and Deploying to Code Engine"}),"\n",(0,t.jsx)(n.p,{children:"If you would like to deploy any of the above-mentioned Embeddable AI NLP service and have it be available for anyone to use, you can follow these steps in order to deploy it. The deployment will be to IBM Cloud\u2019s Code Engine. IBM Cloud Code Engine is a fully managed, cloud-native service for running containerized workloads on IBM Cloud. It allows developers to deploy and run code in a secure, scalable and serverless environment, without having to worry about the underlying infrastructure."}),"\n",(0,t.jsxs)(i,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)("b",{children:(0,t.jsx)("u",{children:"Deploying to Skills Network Code Engine"})})}),(0,t.jsxs)(n.p,{children:["The following steps allow you to test deploy to a IBM's Code Engine envrionement which is managed by Skills Network. This deployment is relatively easier and is recommended to quickly test out that if everything is working just fine.",(0,t.jsx)("br",{}),"\n",(0,t.jsx)(n.strong,{children:"Note: This deployment is temporary and is deleted after a few days."})]}),(0,t.jsx)(n.h5,{id:"1-create-code-engine-project",children:"1. Create Code Engine Project"}),(0,t.jsxs)(n.p,{children:["In the left hand navigation pannel, there is an option for the Skills Network Toolbox. Simply open that and that expand the ",(0,t.jsx)(n.em,{children:"CLOUD"})," section and then click on ",(0,t.jsx)(n.em,{children:"Code Engine"}),". Finally cick on Create Project."]}),(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Create Code Engine Project",src:o(8697).A+"",title:"Create Code Engine Project",width:"2300",height:"1698"})}),(0,t.jsx)(n.h5,{id:"2-click-on-code-engine-cli-button",children:"2. Click on Code Engine CLI Button"}),(0,t.jsx)(n.p,{children:"From the same page simply click on Code Engine CLI button. This will open a new terminal and will login to a code engine project with everything alraedy set up for you."}),(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Code Engine CLI",src:o(5318).A+"",title:"Code Engine CLI",width:"2200",height:"1270"})}),(0,t.jsx)(n.h5,{id:"3-choose-and-deploy-your-desired-embeddable-ai-image",children:"3. Choose and deploy your desired Embeddable AI image"}),(0,t.jsx)(n.p,{children:"To get started, simply run the following command in the terminal and choose the Watson's AI model you would like to use."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud cr image-list --restrict sn-labsassets\n"})}),(0,t.jsxs)(n.p,{children:["After you execute the above command, terminal will output all the different NLP images available. You can then simply choose one of them by copying it's url. For this example, let's say you want to deploy the ",(0,t.jsx)(n.code,{children:"us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime"})," model to Code Engine."]}),(0,t.jsx)(n.p,{children:"Then in the same terminal, run the following commands to deploy the model:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Choose a app name for your Code Engine application\nAPP_NAME="Replace with your Code Engine Application Name"\n\n# Replace with your desired Watson NLP image\nCONTAINER_IMAGE_URL="us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime"\n'})}),(0,t.jsxs)(n.p,{children:["You an also set a visibility for your application, we would recommened to keep it as ",(0,t.jsx)(n.code,{children:"project"})," to restrict any external traffic to it, and only allow the applications within your code engine project to be able to communicate with it as desired. For more infomration about visibility, check out the IBM Cloud Code Engine docs ",(0,t.jsx)(n.a,{href:"https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads#optionsvisibility",children:"here"}),"."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"VISIBILITY=project\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud ce application create \\\n--name ${APP_NAME} \\\n--env ACCEPT_LICENSE=true \\\n--image ${CONTAINER_IMAGE_URL} \\\n--registry-secret icr-secret \\\n--visibility ${VISIBILITY}\n"})}),(0,t.jsx)(n.p,{children:"After the application is ready, it will display the deployed NLP service URL in the terminal. You can then utilize this service URL in the same way as the other pre-existing Watson NLP services provided by Skills Network, and directly incorporate it into any of your other applications that have been deployed to Code Engine."})]}),"\n",(0,t.jsxs)(i,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)("b",{children:(0,t.jsx)("u",{children:"Deploying to your personal IBM Cloud account's Code Engine"})})}),(0,t.jsx)(n.p,{children:"The following steps allow you to deploy the Watson NLP models to your personal IBM Cloud account's Code Engine envrionement. This deployment has some prerequisites and extra steps but ensures that your deployment is permanent untill you delete it yourself."}),(0,t.jsx)(n.h5,{id:"prerequisites",children:"Prerequisites:"}),(0,t.jsxs)(n.p,{children:["Ensure that you have registered for a IBM Cloud account and have enabled the billing. You can ",(0,t.jsx)(n.a,{href:"https://cloud.ibm.com/registration?target=/codeengine/overview",children:"try it at no charge"})," and receive USD$200 in cloud credits."]}),(0,t.jsx)(n.h5,{id:"1-log-in-to-your-ibm-cloud-account",children:"1. Log in to your IBM Cloud account"}),(0,t.jsxs)(n.p,{children:["Using the ",(0,t.jsx)(n.code,{children:"ibmcloud login"})," command log into your own IBM Cloud account. Remember to replace ",(0,t.jsx)(n.code,{children:"USERNAME"})," with your IBM Cloud account email and then enter your password when promted to."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud login -u USERNAME\n"})}),(0,t.jsxs)(n.p,{children:["Use ",(0,t.jsx)(n.code,{children:"ibmcloud login --sso"})," command to login, if you have a federated ID."]}),(0,t.jsxs)(n.p,{children:["Then target any specific resource group in your account. By default, if you've completed the sign up process for your IBM Cloud account, you can use the ",(0,t.jsx)(n.code,{children:"Default"})," resource group."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud target -g Default\n"})}),(0,t.jsx)(n.h5,{id:"2-login-to-the-ibm-entitled-registry",children:"2. Login to the IBM Entitled Registry"}),(0,t.jsx)(n.p,{children:"You'll need to login to IBM Entitled Registry to download the desired Watson NLP models so you can deploy them to your own Code Engine project."}),(0,t.jsxs)(n.p,{children:["Go ",(0,t.jsx)(n.a,{href:"https://myibm.ibm.com/products-services/containerlibrary",children:"IBM's Container Library"})," to get an Entitlement Key. This Key gives you access to pulling and using the IBM Watson Speech Libraries for Embed. However, do note that ",(0,t.jsx)(n.strong,{children:"this key is only valid for a Year as a trial."})]}),(0,t.jsx)(n.p,{children:"Once you've obtained the Entitlement Key from the container software library you can login to the registry with the key, and pull the images."}),(0,t.jsx)(n.p,{children:"Replace it with your own IBM Entitlement Key."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'IBM_ENTITLEMENT_KEY="YOUR_IBM_ENTITLEMENT_KEY"\n'})}),(0,t.jsx)(n.p,{children:"Login to docker registry to pull the images."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"echo $IBM_ENTITLEMENT_KEY | docker login -u cp --password-stdin cp.icr.io\n"})}),(0,t.jsx)(n.h5,{id:"3-choose-and-build-your-desired-embeddable-ai-image",children:"3. Choose and build your desired Embeddable AI image"}),(0,t.jsxs)(n.p,{children:["Similar to deploying the image to Skills Network managed Code Engine, you will first need to choose a model from the ",(0,t.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watson-libraries?topic=models-catalog",children:"model catalog"}),"."]}),(0,t.jsxs)(n.p,{children:["Using the same example as above, let's say you want to deploy the ",(0,t.jsx)(n.code,{children:"sentiment_aggregated-bert-workflow_lang_multi_stock"})," model to Code Engine."]}),(0,t.jsxs)(n.p,{children:["Simply copy it's ",(0,t.jsx)(n.em,{children:"Container Image"})," url as shown below."]}),(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Models Catalog Container Image Url",src:o(1400).A+"",width:"2254",height:"518"})}),(0,t.jsxs)(n.p,{children:["Now simply run the following commands in a terminal to download the chosen model to ",(0,t.jsx)(n.em,{children:"models"})," directory:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'CONTAINER_IMAGE_URL="Replace with the conatiner image url for your chosen model"\nmkdir models\ndocker run -it --rm -e ACCEPT_LICENSE=true -v `pwd`/models:/app/models ${CONTAINER_IMAGE_URL}\n'})}),(0,t.jsxs)(n.p,{children:["After this create a new file called ",(0,t.jsx)(n.code,{children:"Dockerfile"})," and add the following contents to it:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ARG TAG=1.0\nFROM cp.icr.io/cp/ai/watson-nlp-runtime:${TAG}\nCOPY models /app/models\n"})}),(0,t.jsx)(n.p,{children:"Finally build your image by executing this command in your terminal:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"docker build -t my-watson-nlp-runtime:latest\n"})}),(0,t.jsx)(n.h5,{id:"4-create-a-namespace-and-log-in-to-icr",children:"4 Create a namespace and log in to ICR"}),(0,t.jsxs)(n.p,{children:["You will need to create a namespace before you can upload your images, and make sure you're targeting the ICR region you want, which right now is ",(0,t.jsx)(n.code,{children:"global"}),"."]}),(0,t.jsxs)(n.p,{children:["Choose a name for your namespace, specified as ",(0,t.jsx)(n.code,{children:"${NAMESPACE}"}),", and create the namespace. Currently, it's set to ",(0,t.jsx)(n.code,{children:"my-embeddable-ai"}),", you can choose to rename it to anything you choose."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"NAMESPACE=my-embeddable-ai\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud cr region-set global\nibmcloud cr namespace-add ${NAMESPACE}\nibmcloud cr login\n"})}),(0,t.jsx)(n.h5,{id:"6-push-your-image-to-your-namespace",children:"6. Push your image to your namespace"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"REGISTRY=icr.io\n\n# Tag and push the image\ndocker tag my-watson-nlp-runtime:latest ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest\ndocker push ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest\n"})}),(0,t.jsx)(n.h5,{id:"7-deploy-the-image-to-code-engine",children:"7. Deploy the image to Code Engine"}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"1:"})," Target a region and a resource group"]}),(0,t.jsx)(n.p,{children:"Choose the region closest to you and/or your target users. Picking a region closer to you or your users makes the browser extension faster. The further the region the longer the request to the model has to travel."}),(0,t.jsx)(n.p,{children:"You can choose any region from this list:"}),(0,t.jsx)(n.h4,{id:"americas",children:"Americas"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"us-south"})," - Dallas"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"br-sao"})," - Sao Paulo"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"ca-tor"})," - Toronto"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"us-east"})," - Washington DC"]}),"\n"]}),(0,t.jsx)(n.h4,{id:"europe",children:"Europe"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"eu-de"})," - Frankfurt"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"eu-gb"})," - London"]}),"\n"]}),(0,t.jsx)(n.h4,{id:"asia-pacific",children:"Asia Pacific"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"au-syd"})," - Sydney"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"jp-tok"})," - Tokyo"]}),"\n"]}),(0,t.jsx)(n.p,{children:"Use the following commands to target Dallas as the region and the Default resource group."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"REGION=us-south\nRESOURCE_GROUP=Default\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud target -r ${REGION} -g ${RESOURCE_GROUP}\n"})}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"2:"})," Create and Select a new Code Engine project"]}),(0,t.jsxs)(n.p,{children:["In this example, a project named ",(0,t.jsx)(n.code,{children:"my-test-project"})," will be create in the resource group set by the previous command."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud ce project create --name my-test-project\nibmcloud ce project select --name my-test-project\n"})}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"3:"})," Deploy Watson NLP Image"]}),(0,t.jsx)(n.p,{children:"Choose a app name for your Code Engine application and set the container image url you just copied."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'APP_NAME="Replace with your Code Engine Application Name"\n'})}),(0,t.jsxs)(n.p,{children:["You an also set a visibility for your application, we would recommened to keep it as ",(0,t.jsx)(n.code,{children:"project"})," to restrict any external traffic to it, and only allow the applications within your code engine project to be able to communicate with it as desired. For more infomration about visibility and other optional parameters, check out the IBM Cloud Code Engine docs ",(0,t.jsx)(n.a,{href:"https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads",children:"here"}),"."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"VISIBILITY=project\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud ce application create \\\n --name ${APP_NAME} \\\n --port 1080 \\\n --min-scale 1 --max-scale 2 \\\n --cpu 2 --memory 8G \\\n --image private.${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest \\\n --registry-secret ce-auto-icr-private-${REGION} \\\n --visibility ${VISIBILITY} \\\n --env ACCEPT_LICENSE=true\n"})}),(0,t.jsx)(n.p,{children:"After the application is ready, it will display the deployed NLP service URL in the terminal. You can then utilize this service URL in the same way as the other pre-existing Watson NLP services provided by Skills Network, and directly incorporate it into any of your other applications that have been deployed to Code Engine."})]}),"\n",(0,t.jsx)(n.h2,{id:"framework-specific-infomation",children:"Framework-Specific Infomation"}),"\n",(0,t.jsx)(n.h3,{id:"flutter-web-and-cloud-ide",children:"Flutter Web and Cloud IDE"}),"\n",(0,t.jsx)(n.p,{children:"Flutter Web\u2019s hot restart feature, which allows developers to see changes instantly by pressing r in the terminal, doesn\u2019t work as expected in the Cloud IDE due to differences in the environment."}),"\n",(0,t.jsxs)(n.p,{children:["However, there\u2019s a simple workaround with a bash script to mimic the hot reload functionality. Click ",(0,t.jsx)(n.a,{href:"/docs/labs/flutter-web-hot-restart",children:"here"})," for more information on how to use this workaround."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},3939:(e,n,o)=>{o.d(n,{A:()=>i});const i=o.p+"assets/images/cloud-ide-screenshot-c304d94dde20404ce727ac67c505c5e4.png"},5318:(e,n,o)=>{o.d(n,{A:()=>i});const i=o.p+"assets/images/code-engine-cli-button-8ad3995a6077bf633ec4736bed9b48a7.png"},8697:(e,n,o)=>{o.d(n,{A:()=>i});const i=o.p+"assets/images/code-engine-create-project-ea6626a715dce64b7846001a127b008c.png"},1400:(e,n,o)=>{o.d(n,{A:()=>i});const i=o.p+"assets/images/models-catalog-container-image-url-1d72ae1cbc6d36684b5fc2b1e0ce4cd4.png"},8453:(e,n,o)=>{o.d(n,{R:()=>r,x:()=>a});var i=o(6540);const t={},s=i.createContext(t);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/65bcfc64.36fe3044.js b/assets/js/65bcfc64.36fe3044.js new file mode 100644 index 0000000..3b34d48 --- /dev/null +++ b/assets/js/65bcfc64.36fe3044.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkauthor_workbench_knowledgebase=self.webpackChunkauthor_workbench_knowledgebase||[]).push([[314],{8335:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"labs/tools/cloud-ide","title":"Cloud IDE","description":"Cloud IDE is a browser integrated development environment running in the cloud. It supports many programming languages and tools right out of the box so that the users can start working right away without the hassle of tedious setups.","source":"@site/docs/labs/tools/cloud-ide.md","sourceDirName":"labs/tools","slug":"/labs/tools/cloud-ide","permalink":"/docs/labs/tools/cloud-ide","draft":false,"unlisted":false,"editUrl":"https://github.com/ibm-skills-network/author-workbench-knowledgebase/tree/master/docs/labs/tools/cloud-ide.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Introduction","permalink":"/docs/labs/tools/introduction"},"next":{"title":"JupyterLab","permalink":"/docs/labs/tools/jupyterlab"}}');var t=i(4848),s=i(8453);const r={},a="Cloud IDE",l={},d=[{value:"Launch a terminal (all Cloud IDE versions)",id:"launch-a-terminal-all-cloud-ide-versions",level:2},{value:"Docker (Cloud IDE with Kubernetes, Cloud IDE with Openshift)",id:"docker-cloud-ide-with-kubernetes-cloud-ide-with-openshift",level:2},{value:"Volume Mount Points (Cloud IDE with Kubernetes, Cloud IDE with Openshift)",id:"volume-mount-points-cloud-ide-with-kubernetes-cloud-ide-with-openshift",level:3},{value:"Kubernetes (Cloud IDE with Kubernetes)",id:"kubernetes-cloud-ide-with-kubernetes",level:2},{value:"Embeddable AI (All Cloud IDE versions)",id:"embeddable-ai-all-cloud-ide-versions",level:2},{value:"Using the provided Services",id:"using-the-provided-services",level:3},{value:"Building and Deploying to Code Engine (Cloud IDE with Kubernetes, Cloud IDE with Openshift)",id:"building-and-deploying-to-code-engine-cloud-ide-with-kubernetes-cloud-ide-with-openshift",level:3},{value:"1. Create Code Engine Project",id:"1-create-code-engine-project",level:5},{value:"2. Click on Code Engine CLI Button",id:"2-click-on-code-engine-cli-button",level:5},{value:"3. Choose and deploy your desired Embeddable AI image",id:"3-choose-and-deploy-your-desired-embeddable-ai-image",level:5},{value:"Prerequisites:",id:"prerequisites",level:5},{value:"1. Log in to your IBM Cloud account",id:"1-log-in-to-your-ibm-cloud-account",level:5},{value:"2. Login to the IBM Entitled Registry",id:"2-login-to-the-ibm-entitled-registry",level:5},{value:"3. Choose and build your desired Embeddable AI image",id:"3-choose-and-build-your-desired-embeddable-ai-image",level:5},{value:"4 Create a namespace and log in to ICR",id:"4-create-a-namespace-and-log-in-to-icr",level:5},{value:"6. Push your image to your namespace",id:"6-push-your-image-to-your-namespace",level:5},{value:"7. Deploy the image to Code Engine",id:"7-deploy-the-image-to-code-engine",level:5},{value:"Americas",id:"americas",level:4},{value:"Europe",id:"europe",level:4},{value:"Asia Pacific",id:"asia-pacific",level:4},{value:"Framework-Specific Infomation",id:"framework-specific-infomation",level:2},{value:"Flutter Web and Cloud IDE",id:"flutter-web-and-cloud-ide",level:3},{value:"Tips on Writing a Successful Cloud IDE Lab",id:"tips-on-writing-a-successful-cloud-ide-lab",level:2},{value:"1. Provide an overview of the final application early",id:"1-provide-an-overview-of-the-final-application-early",level:3},{value:"2. Include a "Tips for the best experience" page",id:"2-include-a-tips-for-the-best-experience-page",level:3},{value:"3. Offer two learning versions",id:"3-offer-two-learning-versions",level:3}];function c(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",header:"header",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components},{Details:o}=n;return o||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"cloud-ide",children:"Cloud IDE"})}),"\n",(0,t.jsx)(n.p,{children:"Cloud IDE is a browser integrated development environment running in the cloud. It supports many programming languages and tools right out of the box so that the users can start working right away without the hassle of tedious setups.\nUser interface of Cloud IDE, as shown below, comprises of course instructions on the left side and vscode-like development environment on the right side."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Cloud IDE Screenshot interface showing an open project with a code editor, file explorer, and terminal",src:i(3939).A+"",width:"2551",height:"1567"})}),"\n",(0,t.jsxs)(n.p,{children:["There are three versions of Cloud IDE available on Author Workbench: ",(0,t.jsx)(n.strong,{children:"normal Cloud IDE"}),", ",(0,t.jsx)(n.strong,{children:"Cloud IDE with Kubernetes"})," and ",(0,t.jsx)(n.strong,{children:"Cloud IDE with Openshift"}),". Any information specific to only one version of Cloud IDE will be clearly indicated below."]}),"\n",(0,t.jsx)(n.h2,{id:"launch-a-terminal-all-cloud-ide-versions",children:"Launch a terminal (all Cloud IDE versions)"}),"\n",(0,t.jsxs)(n.p,{children:["Click ",(0,t.jsx)(n.code,{children:"Terminal"})," in the menu of the development environment(on the right side of the screen). Then from the dropdown select ",(0,t.jsx)(n.code,{children:"New Terminal"})," and it should open up a new terminal for you."]}),"\n",(0,t.jsx)(n.h2,{id:"docker-cloud-ide-with-kubernetes-cloud-ide-with-openshift",children:"Docker (Cloud IDE with Kubernetes, Cloud IDE with Openshift)"}),"\n",(0,t.jsxs)(n.p,{children:["Docker is an open source platform that is widely used to develop, ship and run applications. Cloud-IDE has built-in support for Docker. You can simply use ",(0,t.jsx)(n.code,{children:"docker"})," cli to run commands. Internally, the docker client(in your IDE) talks to docker daemon, running on a remote host, over a TCP connection. Default user(theia) is configured to run docker commands. Docker commands don't require root privileges. So, don't preface commands with ",(0,t.jsx)(n.code,{children:"sudo"})," or run them with root user. Some examples are:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"docker version\n"})}),"\n",(0,t.jsx)(n.p,{children:"It prints information about the docker client and engine."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"docker container list\n"})}),"\n",(0,t.jsx)(n.p,{children:"It lists the existing containers."}),"\n",(0,t.jsx)(n.h3,{id:"volume-mount-points-cloud-ide-with-kubernetes-cloud-ide-with-openshift",children:"Volume Mount Points (Cloud IDE with Kubernetes, Cloud IDE with Openshift)"}),"\n",(0,t.jsxs)(n.p,{children:["Volume is mounted to persist data from a docker container. Currently, Cloud-IDE only allows mounting data from ",(0,t.jsx)(n.code,{children:"/home/project"})," directory. For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"docker run -itd --name my-first-container -v /home/project/testDir:/app ubuntu:latest\n"})}),"\n",(0,t.jsxs)(n.p,{children:["It spins up ",(0,t.jsx)(n.code,{children:"my-first-container"})," using ",(0,t.jsx)(n.code,{children:"ubuntu:latest"})," image and mounts ",(0,t.jsx)(n.code,{children:"/home/project/testDir"}),"(if it exists in your environment) to the ",(0,t.jsx)(n.code,{children:"/app"})," directory inside the container."]}),"\n",(0,t.jsxs)(n.p,{children:["See the docker ",(0,t.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/docker/",children:"documentation"})," for more commands."]}),"\n",(0,t.jsx)(n.h2,{id:"kubernetes-cloud-ide-with-kubernetes",children:"Kubernetes (Cloud IDE with Kubernetes)"}),"\n",(0,t.jsxs)(n.p,{children:["Kubernetes is an open source container orchestrator which allows to schedule docker containers on large scale compute nodes. It is now a de-facto standard for cloud-native application development and deployment. Cloud-IDE with Kubernetes is already configured to support Kubernetes. It has a pre-installed command line tool called ",(0,t.jsx)(n.code,{children:"kubectl"})," that handles communication with remote kubernetes cluster. Here are a few examples:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"kubectl run my-first-pod --restart=Never --image=ubuntu -- sleep 10s\n"})}),"\n",(0,t.jsxs)(n.p,{children:["It creates a ",(0,t.jsx)(n.code,{children:"my-first-pod"})," that runs a container using ",(0,t.jsx)(n.code,{children:"ubuntu"})," image with ",(0,t.jsx)(n.code,{children:"sleep 10s"})," command. This container spawns ",(0,t.jsx)(n.code,{children:"sleep 10s"})," process."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"kubectl get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"It prints existing pods in your namespace."}),"\n",(0,t.jsxs)(n.p,{children:["More commands can be found in the Kubernetes ",(0,t.jsx)(n.a,{href:"https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands",children:"documentation"})]}),"\n",(0,t.jsx)(n.h2,{id:"embeddable-ai-all-cloud-ide-versions",children:"Embeddable AI (All Cloud IDE versions)"}),"\n",(0,t.jsxs)(n.p,{children:["Cloud IDE supports various Embeddable AI services includes Text-To-Speech, Speech-To-Text, and various Watson NLP services (e.g. sentiment, emotion, etc.). Learners have immediate access to all of these services (via HTTP API calls) to learn, test, and embed in their applications. Moreover, Skills Network provides images for all of these services so learners can ",(0,t.jsx)(n.em,{children:"deploy"})," the services to the provided Code Engine Project, alongisde their applcations (only availble in Cloud IDE with Kubernetes and Cloud IDE with Openshift)."]}),"\n",(0,t.jsx)(n.h3,{id:"using-the-provided-services",children:"Using the provided Services"}),"\n",(0,t.jsxs)(n.p,{children:["All of the services are available to all Cloud IDE learners, for all flavours of Cloud IDE. For example the Text-To-Speech can be accessed at: ",(0,t.jsx)(n.a,{href:"https://sn-watson-tts.labs.skills.network",children:"https://sn-watson-tts.labs.skills.network"}),". To help learners both know what services are available and how to use them the Skills Network Toolbox provides a page for each of the Embeddable AI services which shows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Name and brief description"}),"\n",(0,t.jsx)(n.li,{children:"Available Models"}),"\n",(0,t.jsx)(n.li,{children:"Link to Documentation"}),"\n",(0,t.jsx)(n.li,{children:"Example Commands (with button to easily copy or run in terminal)"}),"\n"]}),"\n",(0,t.jsxs)(o,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)("b",{children:(0,t.jsx)("u",{children:"View Screenshot"})})}),(0,t.jsx)("img",{width:"422",alt:"Skills Network Toolbox interface displaying various AI and NLP tools. Categories include Databases, Big Data, Cloud, and Embeddable AI. Under Embeddable AI, active features include Text-To-Speech and Speech-To-Text. The Watson NLP section lists active features such as Sentiment (BERT, CNN), Categories, Classification, Concepts, Detag, Emotion, Keywords, Language Detection, Noun Phrases, Relations (Transformer), and Syntax. Features labeled 'Coming Soon' include Entity-Mentions (BERT) and Relations (SIRE).",src:"https://user-images.githubusercontent.com/276912/215758158-2c8022b5-7d03-454e-a0bf-ed75e0d08d7d.png"})]}),"\n",(0,t.jsx)(n.p,{children:"Moreover, as an author, within Author IDE, you can add Buttons to your lab's markdown instructions to help learners open these pages with a simple button click. For example, the following markdown creates a button that launches an application running on port 5000:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'::startApplication{port="5000" display="internal" name="Web Application" route="/"} \n'})}),"\n",(0,t.jsxs)(n.p,{children:["The following markdown creates a button that opens the file ",(0,t.jsx)(n.code,{children:"test.py"})," located in the ",(0,t.jsx)(n.code,{children:"/home/project"})," directory:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'::openFile{path="/home/project/test.py"}\n'})}),"\n",(0,t.jsx)(n.h3,{id:"building-and-deploying-to-code-engine-cloud-ide-with-kubernetes-cloud-ide-with-openshift",children:"Building and Deploying to Code Engine (Cloud IDE with Kubernetes, Cloud IDE with Openshift)"}),"\n",(0,t.jsx)(n.p,{children:"If you would like to deploy any of the above-mentioned Embeddable AI NLP service and have it be available for anyone to use, you can follow these steps in order to deploy it. The deployment will be to IBM Cloud\u2019s Code Engine. IBM Cloud Code Engine is a fully managed, cloud-native service for running containerized workloads on IBM Cloud. It allows developers to deploy and run code in a secure, scalable and serverless environment, without having to worry about the underlying infrastructure."}),"\n",(0,t.jsxs)(o,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)("b",{children:(0,t.jsx)("u",{children:"Deploying to Skills Network Code Engine"})})}),(0,t.jsxs)(n.p,{children:["The following steps allow you to test deploy to a IBM's Code Engine envrionement which is managed by Skills Network. This deployment is relatively easier and is recommended to quickly test out that if everything is working just fine.",(0,t.jsx)("br",{}),"\n",(0,t.jsx)(n.strong,{children:"Note: This deployment is temporary and is deleted after a few days."})]}),(0,t.jsx)(n.h5,{id:"1-create-code-engine-project",children:"1. Create Code Engine Project"}),(0,t.jsxs)(n.p,{children:["In the left hand navigation pannel, there is an option for the Skills Network Toolbox. Simply open that and that expand the ",(0,t.jsx)(n.em,{children:"CLOUD"})," section and then click on ",(0,t.jsx)(n.em,{children:"Code Engine"}),". Finally cick on Create Project."]}),(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Cloud IDE interface displaying the Code Engine panel. The Code Engine status is marked as 'Inactive' and 'Not Ready'. A blue 'Create Project' button is highlighted in red. The left sidebar menu includes options such as Databases, Big Data, Cloud, and Other. The Code Engine section is selected, and an AI-related icon is highlighted on the sidebar.",src:i(8697).A+"",title:"Create Code Engine Project",width:"2300",height:"1698"})}),(0,t.jsx)(n.h5,{id:"2-click-on-code-engine-cli-button",children:"2. Click on Code Engine CLI Button"}),(0,t.jsx)(n.p,{children:"From the same page simply click on Code Engine CLI button. This will open a new terminal and will login to a code engine project with everything alraedy set up for you."}),(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Cloud IDE interface showing the Code Engine panel with status marked as 'Ready to Use'. A blue 'Delete Project' button is visible. Below, the summary section provides instructions on using Code Engine. A 'Code Engine CLI' button is highlighted in red, indicating where users can click to access the CLI for interacting with Code Engine. The left sidebar includes categories such as Databases, Big Data, Cloud, and Other, with 'Code Engine' marked as Active.",src:i(5318).A+"",title:"Code Engine CLI",width:"2200",height:"1270"})}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Note:"})," If you get an error ",(0,t.jsx)(n.code,{children:"No project selected"}),", run the following commands in the Code Engine CLI terminal."]}),(0,t.jsx)(n.p,{children:"To list all active projects, use:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"ibmcloud ce project list\n"})}),(0,t.jsx)(n.p,{children:"Take note of the project ID you want to select then run this command to select the project:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"ibmcloud ce project select -id \n"})}),(0,t.jsx)(n.h5,{id:"3-choose-and-deploy-your-desired-embeddable-ai-image",children:"3. Choose and deploy your desired Embeddable AI image"}),(0,t.jsx)(n.p,{children:"To get started, simply run the following command in the terminal and choose the Watson's AI model you would like to use."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud cr image-list --restrict sn-labsassets\n"})}),(0,t.jsxs)(n.p,{children:["After you execute the above command, terminal will output all the different NLP images available. You can then simply choose one of them by copying it's url. For this example, let's say you want to deploy the ",(0,t.jsx)(n.code,{children:"us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime"})," model to Code Engine."]}),(0,t.jsx)(n.p,{children:"Then in the same terminal, run the following commands to deploy the model:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Choose an app name for your Code Engine application\nAPP_NAME="Replace with your Code Engine Application Name"\n\n# Replace with your desired Watson NLP image\nCONTAINER_IMAGE_URL="us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime"\n'})}),(0,t.jsxs)(n.p,{children:["You an also set a visibility for your application, we would recommened to keep it as ",(0,t.jsx)(n.code,{children:"project"})," to restrict any external traffic to it, and only allow the applications within your code engine project to be able to communicate with it as desired. For more infomration about visibility, check out the IBM Cloud Code Engine docs ",(0,t.jsx)(n.a,{href:"https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads#optionsvisibility",children:"here"}),"."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"VISIBILITY=project\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud ce application create \\\n--name ${APP_NAME} \\\n--env ACCEPT_LICENSE=true \\\n--image ${CONTAINER_IMAGE_URL} \\\n--registry-secret icr-secret \\\n--visibility ${VISIBILITY}\n"})}),(0,t.jsx)(n.p,{children:"After the application is ready, it will display the deployed NLP service URL in the terminal. You can then utilize this service URL in the same way as the other pre-existing Watson NLP services provided by Skills Network, and directly incorporate it into any of your other applications that have been deployed to Code Engine."})]}),"\n",(0,t.jsxs)(o,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)("b",{children:(0,t.jsx)("u",{children:"Deploying to your personal IBM Cloud account's Code Engine"})})}),(0,t.jsx)(n.p,{children:"The following steps allow you to deploy the Watson NLP models to your personal IBM Cloud account's Code Engine envrionement. This deployment has some prerequisites and extra steps but ensures that your deployment is permanent untill you delete it yourself."}),(0,t.jsx)(n.h5,{id:"prerequisites",children:"Prerequisites:"}),(0,t.jsxs)(n.p,{children:["Ensure that you have registered for a IBM Cloud account and have enabled the billing. You can ",(0,t.jsx)(n.a,{href:"https://cloud.ibm.com/registration?target=/codeengine/overview",children:"try it at no charge"})," and receive USD$200 in cloud credits."]}),(0,t.jsx)(n.h5,{id:"1-log-in-to-your-ibm-cloud-account",children:"1. Log in to your IBM Cloud account"}),(0,t.jsxs)(n.p,{children:["Using the ",(0,t.jsx)(n.code,{children:"ibmcloud login"})," command log into your own IBM Cloud account. Remember to replace ",(0,t.jsx)(n.code,{children:"USERNAME"})," with your IBM Cloud account email and then enter your password when promted to."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud login -u USERNAME\n"})}),(0,t.jsxs)(n.p,{children:["Use ",(0,t.jsx)(n.code,{children:"ibmcloud login --sso"})," command to login, if you have a federated ID."]}),(0,t.jsxs)(n.p,{children:["Then target any specific resource group in your account. By default, if you've completed the sign up process for your IBM Cloud account, you can use the ",(0,t.jsx)(n.code,{children:"Default"})," resource group."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud target -g Default\n"})}),(0,t.jsx)(n.h5,{id:"2-login-to-the-ibm-entitled-registry",children:"2. Login to the IBM Entitled Registry"}),(0,t.jsx)(n.p,{children:"You'll need to login to IBM Entitled Registry to download the desired Watson NLP models so you can deploy them to your own Code Engine project."}),(0,t.jsxs)(n.p,{children:["Go ",(0,t.jsx)(n.a,{href:"https://myibm.ibm.com/products-services/containerlibrary",children:"IBM's Container Library"})," to get an Entitlement Key. This Key gives you access to pulling and using the IBM Watson Speech Libraries for Embed. However, do note that ",(0,t.jsx)(n.strong,{children:"this key is only valid for a Year as a trial."})]}),(0,t.jsx)(n.p,{children:"Once you've obtained the Entitlement Key from the container software library you can login to the registry with the key, and pull the images."}),(0,t.jsx)(n.p,{children:"Replace it with your own IBM Entitlement Key."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'IBM_ENTITLEMENT_KEY="YOUR_IBM_ENTITLEMENT_KEY"\n'})}),(0,t.jsx)(n.p,{children:"Login to docker registry to pull the images."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"echo $IBM_ENTITLEMENT_KEY | docker login -u cp --password-stdin cp.icr.io\n"})}),(0,t.jsx)(n.h5,{id:"3-choose-and-build-your-desired-embeddable-ai-image",children:"3. Choose and build your desired Embeddable AI image"}),(0,t.jsxs)(n.p,{children:["Similar to deploying the image to Skills Network managed Code Engine, you will first need to choose a model from the ",(0,t.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watson-libraries?topic=models-catalog",children:"model catalog"}),"."]}),(0,t.jsxs)(n.p,{children:["Using the same example as above, let's say you want to deploy the ",(0,t.jsx)(n.code,{children:"sentiment_aggregated-bert-workflow_lang_multi_stock"})," model to Code Engine."]}),(0,t.jsxs)(n.p,{children:["Simply copy it's ",(0,t.jsx)(n.em,{children:"Container Image"})," url as shown below."]}),(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Sentiment model catalog table displaying information for BERT models. The table includes columns for Model ID, Container Image, and Image Digest. The highlighted row shows the model ID as 'sentiment_aggregated-bert-workflow_lang_multi_stock' and the container image URL as 'cp.icr.io/cp/ai/watson-nlp_sentiment_aggregated-bert-workflow_lang_multi_stock:1.0.9'. The Image Digest column contains a long hash value.",src:i(1400).A+"",title:"Models Catalog Container Image",width:"2254",height:"518"})}),(0,t.jsxs)(n.p,{children:["Now simply run the following commands in a terminal to download the chosen model to ",(0,t.jsx)(n.em,{children:"models"})," directory:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'CONTAINER_IMAGE_URL="Replace with the conatiner image url for your chosen model"\nmkdir models\ndocker run -it --rm -e ACCEPT_LICENSE=true -v `pwd`/models:/app/models ${CONTAINER_IMAGE_URL}\n'})}),(0,t.jsxs)(n.p,{children:["After this create a new file called ",(0,t.jsx)(n.code,{children:"Dockerfile"})," and add the following contents to it:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ARG TAG=1.0\nFROM cp.icr.io/cp/ai/watson-nlp-runtime:${TAG}\nCOPY models /app/models\n"})}),(0,t.jsx)(n.p,{children:"Finally build your image by executing this command in your terminal:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"docker build -t my-watson-nlp-runtime:latest\n"})}),(0,t.jsx)(n.h5,{id:"4-create-a-namespace-and-log-in-to-icr",children:"4 Create a namespace and log in to ICR"}),(0,t.jsxs)(n.p,{children:["You will need to create a namespace before you can upload your images, and make sure you're targeting the ICR region you want, which right now is ",(0,t.jsx)(n.code,{children:"global"}),"."]}),(0,t.jsxs)(n.p,{children:["Choose a name for your namespace, specified as ",(0,t.jsx)(n.code,{children:"${NAMESPACE}"}),", and create the namespace. Currently, it's set to ",(0,t.jsx)(n.code,{children:"my-embeddable-ai"}),", you can choose to rename it to anything you choose."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"NAMESPACE=my-embeddable-ai\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud cr region-set global\nibmcloud cr namespace-add ${NAMESPACE}\nibmcloud cr login\n"})}),(0,t.jsx)(n.h5,{id:"6-push-your-image-to-your-namespace",children:"6. Push your image to your namespace"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"REGISTRY=icr.io\n\n# Tag and push the image\ndocker tag my-watson-nlp-runtime:latest ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest\ndocker push ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest\n"})}),(0,t.jsx)(n.h5,{id:"7-deploy-the-image-to-code-engine",children:"7. Deploy the image to Code Engine"}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"1:"})," Target a region and a resource group"]}),(0,t.jsx)(n.p,{children:"Choose the region closest to you and/or your target users. Picking a region closer to you or your users makes the browser extension faster. The further the region the longer the request to the model has to travel."}),(0,t.jsx)(n.p,{children:"You can choose any region from this list:"}),(0,t.jsx)(n.h4,{id:"americas",children:"Americas"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"us-south"})," - Dallas"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"br-sao"})," - Sao Paulo"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"ca-tor"})," - Toronto"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"us-east"})," - Washington DC"]}),"\n"]}),(0,t.jsx)(n.h4,{id:"europe",children:"Europe"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"eu-de"})," - Frankfurt"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"eu-gb"})," - London"]}),"\n"]}),(0,t.jsx)(n.h4,{id:"asia-pacific",children:"Asia Pacific"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"au-syd"})," - Sydney"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"jp-tok"})," - Tokyo"]}),"\n"]}),(0,t.jsx)(n.p,{children:"Use the following commands to target Dallas as the region and the Default resource group."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"REGION=us-south\nRESOURCE_GROUP=Default\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud target -r ${REGION} -g ${RESOURCE_GROUP}\n"})}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"2:"})," Create and Select a new Code Engine project"]}),(0,t.jsxs)(n.p,{children:["In this example, a project named ",(0,t.jsx)(n.code,{children:"my-test-project"})," will be create in the resource group set by the previous command."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud ce project create --name my-test-project\nibmcloud ce project select --name my-test-project\n"})}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"3:"})," Deploy Watson NLP Image"]}),(0,t.jsx)(n.p,{children:"Choose a app name for your Code Engine application and set the container image url you just copied."}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'APP_NAME="Replace with your Code Engine Application Name"\n'})}),(0,t.jsxs)(n.p,{children:["You an also set a visibility for your application, we would recommened to keep it as ",(0,t.jsx)(n.code,{children:"project"})," to restrict any external traffic to it, and only allow the applications within your code engine project to be able to communicate with it as desired. For more infomration about visibility and other optional parameters, check out the IBM Cloud Code Engine docs ",(0,t.jsx)(n.a,{href:"https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads",children:"here"}),"."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"VISIBILITY=project\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ibmcloud ce application create \\\n --name ${APP_NAME} \\\n --port 1080 \\\n --min-scale 1 --max-scale 2 \\\n --cpu 2 --memory 8G \\\n --image private.${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest \\\n --registry-secret ce-auto-icr-private-${REGION} \\\n --visibility ${VISIBILITY} \\\n --env ACCEPT_LICENSE=true\n"})}),(0,t.jsx)(n.p,{children:"After the application is ready, it will display the deployed NLP service URL in the terminal. You can then utilize this service URL in the same way as the other pre-existing Watson NLP services provided by Skills Network, and directly incorporate it into any of your other applications that have been deployed to Code Engine."})]}),"\n",(0,t.jsx)(n.h2,{id:"framework-specific-infomation",children:"Framework-Specific Infomation"}),"\n",(0,t.jsx)(n.h3,{id:"flutter-web-and-cloud-ide",children:"Flutter Web and Cloud IDE"}),"\n",(0,t.jsx)(n.p,{children:"Flutter Web\u2019s hot restart feature, which allows developers to see changes instantly by pressing r in the terminal, doesn\u2019t work as expected in the Cloud IDE due to differences in the environment."}),"\n",(0,t.jsxs)(n.p,{children:["However, there\u2019s a simple workaround with a bash script to mimic the hot reload functionality. Click ",(0,t.jsx)(n.a,{href:"/docs/labs/flutter-web-hot-restart",children:"here"})," for more information on how to use this workaround."]}),"\n",(0,t.jsx)(n.h2,{id:"tips-on-writing-a-successful-cloud-ide-lab",children:"Tips on Writing a Successful Cloud IDE Lab"}),"\n",(0,t.jsx)(n.p,{children:"Creating an effective Cloud IDE lab requires careful planning to ensure learners have a smooth and engaging experience. Below are key tips to enhance the structure and learning outcomes of your lab."}),"\n",(0,t.jsx)(n.h3,{id:"1-provide-an-overview-of-the-final-application-early",children:"1. Provide an overview of the final application early"}),"\n",(0,t.jsx)(n.p,{children:"If your lab involves building an application, include an overview within the first few pages. This helps learners understand the end goal and visualize what they will achieve by the end of the lab."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"An overview of AI NutriCoach app interface displaying an image-based nutritional analysis tool. The interface includes an 'Upload Image' section where users can upload a food image. There are options for entering dietary restrictions and selecting a workflow type (recipe or analysis). The results section provides a nutritional breakdown of the dish, including estimated calories and macronutrient content. A table on the right side lists example images, dietary restrictions, and workflow types.",src:i(4424).A+"",title:"App Overview Example",width:"1784",height:"1414"})}),"\n",(0,t.jsxs)("center",{children:[" ",(0,t.jsx)(n.em,{children:"Example - AI NutriCoach App Overview"})," "]}),"\n",(0,t.jsxs)(n.h3,{id:"2-include-a-tips-for-the-best-experience-page",children:["2. Include a ",(0,t.jsx)(n.strong,{children:'"Tips for the best experience"'})," page"]}),"\n",(0,t.jsxs)(n.p,{children:["Early in the lab, provide a dedicated ",(0,t.jsx)(n.strong,{children:'"Tips for the best experience"'})," page to help learners navigate the tutorial smoothly. This page should serve as a reference point for troubleshooting and best practices throughout the lab. Key elements to include:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Guidance on Navigation"})," \u2013 Explain how to use the ",(0,t.jsx)(n.strong,{children:"Table of Contents"})," to quickly find sections and avoid getting lost."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Quick Start Option"})," \u2013 Offer a ",(0,t.jsx)(n.strong,{children:"fast-track"})," method for learners who want to see the final result early."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Cloud IDE Best Practices"})," \u2013 Cover essential tips such as ",(0,t.jsx)(n.strong,{children:"saving work, running code blocks, and ensuring the correct project directory"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Application Execution Instructions"})," \u2013 Provide reminders on keeping ",(0,t.jsx)(n.code,{children:"app.py"})," running, using the correct port, and refreshing the application when needed."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Troubleshooting Tips"})," \u2013 Include solutions for common issues like ",(0,t.jsx)(n.strong,{children:"server errors, unstable models, or access problems"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["This page acts as a ",(0,t.jsx)(n.strong,{children:"go-to cheat sheet"})," that learners can refer back to whenever they encounter confusion or errors."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Screenshot of the 'Tips for the Best Experience - Please Read!' page in a tutorial. The page provides guidance on following a quick version of the tutorial, using the Table of Contents for navigation, and saving work. A highlighted red box emphasizes the Table of Contents icon in the top left corner, showing a dropdown menu with a list of tutorial sections. Additional tips on saving work and retrieving updated scripts at the end of each section are also visible.",src:i(9414).A+"",title:"Tips for best experience example",width:"1880",height:"1534"})}),"\n",(0,t.jsxs)("center",{children:[" ",(0,t.jsx)(n.em,{children:"Example - Tips for best experience"})," "]}),"\n",(0,t.jsx)(n.h3,{id:"3-offer-two-learning-versions",children:"3. Offer two learning versions"}),"\n",(0,t.jsx)(n.p,{children:"To accommodate different learning styles and time constraints, provide two options:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Quick version:"})," Guide learners to get the final application up and running within the first few pages. This helps those who want quick results.\n",(0,t.jsx)(n.img,{alt:"Screenshot of the 'Quick version - run the final app' page in a tutorial. The page provides a step-by-step guide to quickly setting up and running the NutriCoach application. It includes three main steps: cloning the GitHub repository, setting up a Python virtual environment, and installing required libraries. The page emphasizes that this section is for users who want to get the final app running immediately, with a disclaimer advising others to skip ahead for the full tutorial. Code snippets with run buttons are included for ease of execution.",src:i(4359).A+"",title:"Quick version example",width:"1864",height:"1440"})]}),"\n"]}),"\n",(0,t.jsxs)("center",{children:[" ",(0,t.jsx)(n.em,{children:"Example - Quick version"})," "]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Full version:"})," Once the application is running, encourage learners to continue through the rest of the lab to explore deeper explanations, code breakdowns, and additional insights."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"By structuring your Cloud IDE lab in this way, you can cater to both quick learners who want a fast setup and those who prefer an in-depth understanding of the implementation."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},4424:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/app-overview-example-392dbd467597c265e8409f731b564f34.png"},3939:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/cloud-ide-screenshot-c304d94dde20404ce727ac67c505c5e4.png"},5318:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/code-engine-cli-button-8ad3995a6077bf633ec4736bed9b48a7.png"},8697:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/code-engine-create-project-ea6626a715dce64b7846001a127b008c.png"},1400:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/models-catalog-container-image-url-1d72ae1cbc6d36684b5fc2b1e0ce4cd4.png"},4359:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/short-course-example-7043b9c721fe72a06530daaa42c3f987.png"},9414:(e,n,i)=>{i.d(n,{A:()=>o});const o=i.p+"assets/images/tips-for-best-experience-5141f4d27498a9ce2a6dc8bc9ac964ec.png"},8453:(e,n,i)=>{i.d(n,{R:()=>r,x:()=>a});var o=i(6540);const t={},s=o.createContext(t);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.f401c365.js b/assets/js/runtime~main.6280fb28.js similarity index 98% rename from assets/js/runtime~main.f401c365.js rename to assets/js/runtime~main.6280fb28.js index e1670d3..f1b9583 100644 --- a/assets/js/runtime~main.f401c365.js +++ b/assets/js/runtime~main.6280fb28.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,o,n={},d={};function c(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.m=n,c.c=d,e=[],c.O=(t,r,a,o)=>{if(!r){var n=1/0;for(b=0;b=o)&&Object.keys(c.O).every((e=>c.O[e](r[f])))?r.splice(f--,1):(d=!1,o0&&e[b-1][2]>o;b--)e[b]=e[b-1];e[b]=[r,a,o]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var d=2&a&&e;"object"==typeof d&&!~t.indexOf(d);d=r(d))Object.getOwnPropertyNames(d).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,c.d(o,n),o},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,r)=>(c.f[r](e,t),t)),[])),c.u=e=>"assets/js/"+({48:"a94703ab",78:"03f53bdf",98:"a7bd4aaa",151:"42239457",166:"fea1c456",183:"11d50d29",188:"7321aaff",198:"536a7601",204:"63c756cd",256:"11b43341",287:"9d3e16d2",296:"7f9ac86a",312:"465b9d18",314:"65bcfc64",401:"17896441",420:"2c962096",492:"e5bdee78",526:"2e2a8153",647:"5e95c892",652:"351db62b",702:"5157f4d5",727:"4f4a9703",742:"aba21aa0",903:"55187387",917:"2f308ee9",924:"d589d3a7"}[e]||e)+"."+{42:"99fc55bf",48:"2bdef895",78:"be903495",98:"7d853de5",151:"79e4e925",166:"49d7222f",183:"16dfba41",188:"eb5f0b90",198:"c9c6b972",204:"bab28ff9",256:"b37313b8",287:"cb87f961",296:"e9ab75b5",312:"a0226ea0",314:"21d0a15b",401:"34b2dce1",420:"2d4bf7cf",492:"58eddd9a",526:"0132671f",647:"658a4725",652:"8f63eef5",702:"477d8fb9",727:"4222622a",742:"1b90718f",903:"d4054e30",917:"0d1a5f5f",924:"cbbdc030"}[e]+".js",c.miniCssF=e=>{},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="author-workbench-knowledgebase:",c.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var d,f;if(void 0!==r)for(var i=document.getElementsByTagName("script"),b=0;b{d.onerror=d.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],d.parentNode&&d.parentNode.removeChild(d),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),f&&document.head.appendChild(d)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/docs/",c.gca=function(e){return e={17896441:"401",42239457:"151",55187387:"903",a94703ab:"48","03f53bdf":"78",a7bd4aaa:"98",fea1c456:"166","11d50d29":"183","7321aaff":"188","536a7601":"198","63c756cd":"204","11b43341":"256","9d3e16d2":"287","7f9ac86a":"296","465b9d18":"312","65bcfc64":"314","2c962096":"420",e5bdee78:"492","2e2a8153":"526","5e95c892":"647","351db62b":"652","5157f4d5":"702","4f4a9703":"727",aba21aa0:"742","2f308ee9":"917",d589d3a7:"924"}[e]||e,c.p+c.u(e)},(()=>{var e={354:0,869:0};c.f.j=(t,r)=>{var a=c.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=c.p+c.u(t),d=new Error;c.l(n,(r=>{if(c.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;d.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",d.name="ChunkLoadError",d.type=o,d.request=n,a[1](d)}}),"chunk-"+t,t)}},c.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],d=r[1],f=r[2],i=0;if(n.some((t=>0!==e[t]))){for(a in d)c.o(d,a)&&(c.m[a]=d[a]);if(f)var b=f(c)}for(t&&t(r);i{"use strict";var e,t,r,a,o,n={},d={};function c(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.m=n,c.c=d,e=[],c.O=(t,r,a,o)=>{if(!r){var n=1/0;for(b=0;b=o)&&Object.keys(c.O).every((e=>c.O[e](r[f])))?r.splice(f--,1):(d=!1,o0&&e[b-1][2]>o;b--)e[b]=e[b-1];e[b]=[r,a,o]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var d=2&a&&e;"object"==typeof d&&!~t.indexOf(d);d=r(d))Object.getOwnPropertyNames(d).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,c.d(o,n),o},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,r)=>(c.f[r](e,t),t)),[])),c.u=e=>"assets/js/"+({48:"a94703ab",78:"03f53bdf",98:"a7bd4aaa",151:"42239457",166:"fea1c456",183:"11d50d29",188:"7321aaff",198:"536a7601",204:"63c756cd",256:"11b43341",287:"9d3e16d2",296:"7f9ac86a",312:"465b9d18",314:"65bcfc64",401:"17896441",420:"2c962096",492:"e5bdee78",526:"2e2a8153",647:"5e95c892",652:"351db62b",702:"5157f4d5",727:"4f4a9703",742:"aba21aa0",903:"55187387",917:"2f308ee9",924:"d589d3a7"}[e]||e)+"."+{42:"99fc55bf",48:"2bdef895",78:"be903495",98:"7d853de5",151:"79e4e925",166:"49d7222f",183:"16dfba41",188:"eb5f0b90",198:"c9c6b972",204:"bab28ff9",256:"b37313b8",287:"cb87f961",296:"e9ab75b5",312:"a0226ea0",314:"36fe3044",401:"34b2dce1",420:"2d4bf7cf",492:"58eddd9a",526:"0132671f",647:"658a4725",652:"8f63eef5",702:"477d8fb9",727:"4222622a",742:"1b90718f",903:"d4054e30",917:"0d1a5f5f",924:"cbbdc030"}[e]+".js",c.miniCssF=e=>{},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="author-workbench-knowledgebase:",c.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var d,f;if(void 0!==r)for(var i=document.getElementsByTagName("script"),b=0;b{d.onerror=d.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],d.parentNode&&d.parentNode.removeChild(d),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),f&&document.head.appendChild(d)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/docs/",c.gca=function(e){return e={17896441:"401",42239457:"151",55187387:"903",a94703ab:"48","03f53bdf":"78",a7bd4aaa:"98",fea1c456:"166","11d50d29":"183","7321aaff":"188","536a7601":"198","63c756cd":"204","11b43341":"256","9d3e16d2":"287","7f9ac86a":"296","465b9d18":"312","65bcfc64":"314","2c962096":"420",e5bdee78:"492","2e2a8153":"526","5e95c892":"647","351db62b":"652","5157f4d5":"702","4f4a9703":"727",aba21aa0:"742","2f308ee9":"917",d589d3a7:"924"}[e]||e,c.p+c.u(e)},(()=>{var e={354:0,869:0};c.f.j=(t,r)=>{var a=c.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=c.p+c.u(t),d=new Error;c.l(n,(r=>{if(c.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;d.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",d.name="ChunkLoadError",d.type=o,d.request=n,a[1](d)}}),"chunk-"+t,t)}},c.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],d=r[1],f=r[2],i=0;if(n.some((t=>0!==e[t]))){for(a in d)c.o(d,a)&&(c.m[a]=d[a]);if(f)var b=f(c)}for(t&&t(r);i Invite Beta Testers | Skills Network Knowledge Base - + diff --git a/guided-projects/advanced/configuring-sn-labs-tool-config/index.html b/guided-projects/advanced/configuring-sn-labs-tool-config/index.html index abdc6ea..0c94d69 100644 --- a/guided-projects/advanced/configuring-sn-labs-tool-config/index.html +++ b/guided-projects/advanced/configuring-sn-labs-tool-config/index.html @@ -4,7 +4,7 @@ Using a Custom Outline | Skills Network Knowledge Base - + diff --git a/img/labs/app-overview-example.png b/img/labs/app-overview-example.png new file mode 100644 index 0000000..d09379a Binary files /dev/null and b/img/labs/app-overview-example.png differ diff --git a/img/labs/short-course-example.png b/img/labs/short-course-example.png new file mode 100644 index 0000000..9b83256 Binary files /dev/null and b/img/labs/short-course-example.png differ diff --git a/img/labs/tips-for-best-experience.png b/img/labs/tips-for-best-experience.png new file mode 100644 index 0000000..f0b1be4 Binary files /dev/null and b/img/labs/tips-for-best-experience.png differ diff --git a/index.html b/index.html index d1c1ee2..70e50d1 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Getting Started | Skills Network Knowledge Base - + diff --git a/labs/adding-labs-to-courses/add-a-lab-to-a-coursera-course/index.html b/labs/adding-labs-to-courses/add-a-lab-to-a-coursera-course/index.html index 043f109..d07340d 100644 --- a/labs/adding-labs-to-courses/add-a-lab-to-a-coursera-course/index.html +++ b/labs/adding-labs-to-courses/add-a-lab-to-a-coursera-course/index.html @@ -4,7 +4,7 @@ Add a Lab to your Coursera Course | Skills Network Knowledge Base - + diff --git a/labs/adding-labs-to-courses/add-a-lab-to-a-skills-network-course/index.html b/labs/adding-labs-to-courses/add-a-lab-to-a-skills-network-course/index.html index df0483c..5c091b3 100644 --- a/labs/adding-labs-to-courses/add-a-lab-to-a-skills-network-course/index.html +++ b/labs/adding-labs-to-courses/add-a-lab-to-a-skills-network-course/index.html @@ -4,7 +4,7 @@ Add a Lab to your Skills Network Course | Skills Network Knowledge Base - + diff --git a/labs/adding-labs-to-courses/add-a-lab-to-an-edx-org-course/index.html b/labs/adding-labs-to-courses/add-a-lab-to-an-edx-org-course/index.html index ec4c63c..42057e4 100644 --- a/labs/adding-labs-to-courses/add-a-lab-to-an-edx-org-course/index.html +++ b/labs/adding-labs-to-courses/add-a-lab-to-an-edx-org-course/index.html @@ -4,7 +4,7 @@ Add a Lab to your edX.org Course | Skills Network Knowledge Base - + diff --git a/labs/claim-ibm-cloud-trial/index.html b/labs/claim-ibm-cloud-trial/index.html index 13e097e..c590f25 100644 --- a/labs/claim-ibm-cloud-trial/index.html +++ b/labs/claim-ibm-cloud-trial/index.html @@ -4,7 +4,7 @@ Claim an IBM Cloud Trial code | Skills Network Knowledge Base - + diff --git a/labs/create-a-lab/index.html b/labs/create-a-lab/index.html index 96675b0..9cc8a90 100644 --- a/labs/create-a-lab/index.html +++ b/labs/create-a-lab/index.html @@ -4,7 +4,7 @@ Create a Lab | Skills Network Knowledge Base - + diff --git a/labs/edit-jupyterlab-instructions-computer/index.html b/labs/edit-jupyterlab-instructions-computer/index.html index 4673397..f38ab8e 100644 --- a/labs/edit-jupyterlab-instructions-computer/index.html +++ b/labs/edit-jupyterlab-instructions-computer/index.html @@ -4,7 +4,7 @@ Author Jupyter Notebooks on Your Machine | Skills Network Knowledge Base - + diff --git a/labs/flutter-web-hot-restart/index.html b/labs/flutter-web-hot-restart/index.html index 4189257..a5df021 100644 --- a/labs/flutter-web-hot-restart/index.html +++ b/labs/flutter-web-hot-restart/index.html @@ -4,7 +4,7 @@ Flutter Web Hot Restart in Cloud IDE | Skills Network Knowledge Base - + diff --git a/labs/free-apis/index.html b/labs/free-apis/index.html index 3cec541..1699596 100644 --- a/labs/free-apis/index.html +++ b/labs/free-apis/index.html @@ -4,7 +4,7 @@ Free APIs Available in Skills Network Labs | Skills Network Knowledge Base - + diff --git a/labs/jupyterlab-filelibrary/index.html b/labs/jupyterlab-filelibrary/index.html index 94ce081..9f80f4c 100644 --- a/labs/jupyterlab-filelibrary/index.html +++ b/labs/jupyterlab-filelibrary/index.html @@ -4,7 +4,7 @@ Access File Library within Author Workbench | Skills Network Knowledge Base - + diff --git a/labs/jupyterlite-vs-jupyterlab/index.html b/labs/jupyterlite-vs-jupyterlab/index.html index 2bc1587..145e34a 100644 --- a/labs/jupyterlite-vs-jupyterlab/index.html +++ b/labs/jupyterlite-vs-jupyterlab/index.html @@ -4,7 +4,7 @@ JupyterLite vs JupyterLab | Skills Network Knowledge Base - + diff --git a/labs/misc/manim/index.html b/labs/misc/manim/index.html index ff465b8..88c70e2 100644 --- a/labs/misc/manim/index.html +++ b/labs/misc/manim/index.html @@ -4,7 +4,7 @@ Manim for Animated Videos | Skills Network Knowledge Base - + diff --git a/labs/network-egress/index.html b/labs/network-egress/index.html index a241974..bec184e 100644 --- a/labs/network-egress/index.html +++ b/labs/network-egress/index.html @@ -4,7 +4,7 @@ Skills Network Labs Egress Firewall | Skills Network Knowledge Base - + diff --git a/labs/tools/cloud-ide/index.html b/labs/tools/cloud-ide/index.html index 1a10643..ddd50b2 100644 --- a/labs/tools/cloud-ide/index.html +++ b/labs/tools/cloud-ide/index.html @@ -4,36 +4,37 @@ Cloud IDE | Skills Network Knowledge Base - +

Cloud IDE

Cloud IDE is a browser integrated development environment running in the cloud. It supports many programming languages and tools right out of the box so that the users can start working right away without the hassle of tedious setups. User interface of Cloud IDE, as shown below, comprises of course instructions on the left side and vscode-like development environment on the right side.

-

Cloud IDE Screenshot

-

Launch a terminal

+

Cloud IDE Screenshot interface showing an open project with a code editor, file explorer, and terminal

+

There are three versions of Cloud IDE available on Author Workbench: normal Cloud IDE, Cloud IDE with Kubernetes and Cloud IDE with Openshift. Any information specific to only one version of Cloud IDE will be clearly indicated below.

+

Launch a terminal (all Cloud IDE versions)

Click Terminal in the menu of the development environment(on the right side of the screen). Then from the dropdown select New Terminal and it should open up a new terminal for you.

-

Docker

+

Docker (Cloud IDE with Kubernetes, Cloud IDE with Openshift)

Docker is an open source platform that is widely used to develop, ship and run applications. Cloud-IDE has built-in support for Docker. You can simply use docker cli to run commands. Internally, the docker client(in your IDE) talks to docker daemon, running on a remote host, over a TCP connection. Default user(theia) is configured to run docker commands. Docker commands don't require root privileges. So, don't preface commands with sudo or run them with root user. Some examples are:

docker version

It prints information about the docker client and engine.

docker container list

It lists the existing containers.

-

Volume Mount Points

+

Volume Mount Points (Cloud IDE with Kubernetes, Cloud IDE with Openshift)

Volume is mounted to persist data from a docker container. Currently, Cloud-IDE only allows mounting data from /home/project directory. For example:

docker run -itd --name my-first-container -v /home/project/testDir:/app ubuntu:latest

It spins up my-first-container using ubuntu:latest image and mounts /home/project/testDir(if it exists in your environment) to the /app directory inside the container.

See the docker documentation for more commands.

-

Kubernetes

-

Kubernetes is an open source container orchestrator which allows to schedule docker containers on large scale compute nodes. It is now a de-facto standard for cloud-native application development and deployment. Cloud-IDE is already configured to support Kubernetes. It has a pre-installed command line tool called kubectl that handles communication with remote kubernetes cluster. Here are a few examples:

+

Kubernetes (Cloud IDE with Kubernetes)

+

Kubernetes is an open source container orchestrator which allows to schedule docker containers on large scale compute nodes. It is now a de-facto standard for cloud-native application development and deployment. Cloud-IDE with Kubernetes is already configured to support Kubernetes. It has a pre-installed command line tool called kubectl that handles communication with remote kubernetes cluster. Here are a few examples:

kubectl run my-first-pod --restart=Never --image=ubuntu -- sleep 10s

It creates a my-first-pod that runs a container using ubuntu image with sleep 10s command. This container spawns sleep 10s process.

kubectl get pods

It prints existing pods in your namespace.

More commands can be found in the Kubernetes documentation

-

Embeddable AI

-

Cloud IDE supports various Embeddable AI services includes Text-To-Speech, Speech-To-Text, and various Watson NLP services (e.g. sentiment, emotion, etc.). Learners have immediate access to all of these services (via HTTP API calls) to learn, test, and embed in their applications. Moreover, Skills Network provides images for all of these services so learners can deploy the services to the provided Code Engine Project, alongisde their applcations.

+

Embeddable AI (All Cloud IDE versions)

+

Cloud IDE supports various Embeddable AI services includes Text-To-Speech, Speech-To-Text, and various Watson NLP services (e.g. sentiment, emotion, etc.). Learners have immediate access to all of these services (via HTTP API calls) to learn, test, and embed in their applications. Moreover, Skills Network provides images for all of these services so learners can deploy the services to the provided Code Engine Project, alongisde their applcations (only availble in Cloud IDE with Kubernetes and Cloud IDE with Openshift).

Using the provided Services

All of the services are available to all Cloud IDE learners, for all flavours of Cloud IDE. For example the Text-To-Speech can be accessed at: https://sn-watson-tts.labs.skills.network. To help learners both know what services are available and how to use them the Skills Network Toolbox provides a page for each of the Embeddable AI services which shows:

    @@ -42,13 +43,16 @@

  • Link to Documentation
  • Example Commands (with button to easily copy or run in terminal)
-
View Screenshot
image
-

Moreover, as an author, within Author IDE, you can add Buttons to your lab's markdown instructions to help learners open these pages with a simple button click.

-

Building and Deploying to Code Engine

+
View Screenshot
Skills Network Toolbox interface displaying various AI and NLP tools. Categories include Databases, Big Data, Cloud, and Embeddable AI. Under Embeddable AI, active features include Text-To-Speech and Speech-To-Text. The Watson NLP section lists active features such as Sentiment (BERT, CNN), Categories, Classification, Concepts, Detag, Emotion, Keywords, Language Detection, Noun Phrases, Relations (Transformer), and Syntax. Features labeled 'Coming Soon' include Entity-Mentions (BERT) and Relations (SIRE).
+

Moreover, as an author, within Author IDE, you can add Buttons to your lab's markdown instructions to help learners open these pages with a simple button click. For example, the following markdown creates a button that launches an application running on port 5000:

+
::startApplication{port="5000" display="internal" name="Web Application" route="/"}  
+

The following markdown creates a button that opens the file test.py located in the /home/project directory:

+
::openFile{path="/home/project/test.py"}
+

Building and Deploying to Code Engine (Cloud IDE with Kubernetes, Cloud IDE with Openshift)

If you would like to deploy any of the above-mentioned Embeddable AI NLP service and have it be available for anyone to use, you can follow these steps in order to deploy it. The deployment will be to IBM Cloud’s Code Engine. IBM Cloud Code Engine is a fully managed, cloud-native service for running containerized workloads on IBM Cloud. It allows developers to deploy and run code in a secure, scalable and serverless environment, without having to worry about the underlying infrastructure.

Deploying to Skills Network Code Engine

The following steps allow you to test deploy to a IBM's Code Engine envrionement which is managed by Skills Network. This deployment is relatively easier and is recommended to quickly test out that if everything is working just fine.
-Note: This deployment is temporary and is deleted after a few days.

1. Create Code Engine Project

In the left hand navigation pannel, there is an option for the Skills Network Toolbox. Simply open that and that expand the CLOUD section and then click on Code Engine. Finally cick on Create Project.

Create Code Engine Project

2. Click on Code Engine CLI Button

From the same page simply click on Code Engine CLI button. This will open a new terminal and will login to a code engine project with everything alraedy set up for you.

Code Engine CLI

3. Choose and deploy your desired Embeddable AI image

To get started, simply run the following command in the terminal and choose the Watson's AI model you would like to use.

ibmcloud cr image-list --restrict sn-labsassets

After you execute the above command, terminal will output all the different NLP images available. You can then simply choose one of them by copying it's url. For this example, let's say you want to deploy the us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime model to Code Engine.

Then in the same terminal, run the following commands to deploy the model:

# Choose a app name for your Code Engine application
APP_NAME="Replace with your Code Engine Application Name"

# Replace with your desired Watson NLP image
CONTAINER_IMAGE_URL="us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime"

You an also set a visibility for your application, we would recommened to keep it as project to restrict any external traffic to it, and only allow the applications within your code engine project to be able to communicate with it as desired. For more infomration about visibility, check out the IBM Cloud Code Engine docs here.

VISIBILITY=project
ibmcloud ce application create \
--name ${APP_NAME} \
--env ACCEPT_LICENSE=true \
--image ${CONTAINER_IMAGE_URL} \
--registry-secret icr-secret \
--visibility ${VISIBILITY}

After the application is ready, it will display the deployed NLP service URL in the terminal. You can then utilize this service URL in the same way as the other pre-existing Watson NLP services provided by Skills Network, and directly incorporate it into any of your other applications that have been deployed to Code Engine.

-
Deploying to your personal IBM Cloud account's Code Engine

The following steps allow you to deploy the Watson NLP models to your personal IBM Cloud account's Code Engine envrionement. This deployment has some prerequisites and extra steps but ensures that your deployment is permanent untill you delete it yourself.

Prerequisites:

Ensure that you have registered for a IBM Cloud account and have enabled the billing. You can try it at no charge and receive USD$200 in cloud credits.

1. Log in to your IBM Cloud account

Using the ibmcloud login command log into your own IBM Cloud account. Remember to replace USERNAME with your IBM Cloud account email and then enter your password when promted to.

ibmcloud login -u USERNAME

Use ibmcloud login --sso command to login, if you have a federated ID.

Then target any specific resource group in your account. By default, if you've completed the sign up process for your IBM Cloud account, you can use the Default resource group.

ibmcloud target -g Default
2. Login to the IBM Entitled Registry

You'll need to login to IBM Entitled Registry to download the desired Watson NLP models so you can deploy them to your own Code Engine project.

Go IBM's Container Library to get an Entitlement Key. This Key gives you access to pulling and using the IBM Watson Speech Libraries for Embed. However, do note that this key is only valid for a Year as a trial.

Once you've obtained the Entitlement Key from the container software library you can login to the registry with the key, and pull the images.

Replace it with your own IBM Entitlement Key.

IBM_ENTITLEMENT_KEY="YOUR_IBM_ENTITLEMENT_KEY"

Login to docker registry to pull the images.

echo $IBM_ENTITLEMENT_KEY | docker login -u cp --password-stdin cp.icr.io
3. Choose and build your desired Embeddable AI image

Similar to deploying the image to Skills Network managed Code Engine, you will first need to choose a model from the model catalog.

Using the same example as above, let's say you want to deploy the sentiment_aggregated-bert-workflow_lang_multi_stock model to Code Engine.

Simply copy it's Container Image url as shown below.

Models Catalog Container Image Url

Now simply run the following commands in a terminal to download the chosen model to models directory:

CONTAINER_IMAGE_URL="Replace with the conatiner image url for your chosen model"
mkdir models
docker run -it --rm -e ACCEPT_LICENSE=true -v `pwd`/models:/app/models ${CONTAINER_IMAGE_URL}

After this create a new file called Dockerfile and add the following contents to it:

ARG TAG=1.0
FROM cp.icr.io/cp/ai/watson-nlp-runtime:${TAG}
COPY models /app/models

Finally build your image by executing this command in your terminal:

docker build -t my-watson-nlp-runtime:latest
4 Create a namespace and log in to ICR

You will need to create a namespace before you can upload your images, and make sure you're targeting the ICR region you want, which right now is global.

Choose a name for your namespace, specified as ${NAMESPACE}, and create the namespace. Currently, it's set to my-embeddable-ai, you can choose to rename it to anything you choose.

NAMESPACE=my-embeddable-ai
ibmcloud cr region-set global
ibmcloud cr namespace-add ${NAMESPACE}
ibmcloud cr login
6. Push your image to your namespace
REGISTRY=icr.io

# Tag and push the image
docker tag my-watson-nlp-runtime:latest ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest
docker push ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest
7. Deploy the image to Code Engine

1: Target a region and a resource group

Choose the region closest to you and/or your target users. Picking a region closer to you or your users makes the browser extension faster. The further the region the longer the request to the model has to travel.

You can choose any region from this list:

Americas

    +Note: This deployment is temporary and is deleted after a few days.

    1. Create Code Engine Project

    In the left hand navigation pannel, there is an option for the Skills Network Toolbox. Simply open that and that expand the CLOUD section and then click on Code Engine. Finally cick on Create Project.

    Cloud IDE interface displaying the Code Engine panel. The Code Engine status is marked as 'Inactive' and 'Not Ready'. A blue 'Create Project' button is highlighted in red. The left sidebar menu includes options such as Databases, Big Data, Cloud, and Other. The Code Engine section is selected, and an AI-related icon is highlighted on the sidebar.

    2. Click on Code Engine CLI Button

    From the same page simply click on Code Engine CLI button. This will open a new terminal and will login to a code engine project with everything alraedy set up for you.

    Cloud IDE interface showing the Code Engine panel with status marked as 'Ready to Use'. A blue 'Delete Project' button is visible. Below, the summary section provides instructions on using Code Engine. A 'Code Engine CLI' button is highlighted in red, indicating where users can click to access the CLI for interacting with Code Engine. The left sidebar includes categories such as Databases, Big Data, Cloud, and Other, with 'Code Engine' marked as Active.

    Note: If you get an error No project selected, run the following commands in the Code Engine CLI terminal.

    To list all active projects, use:

    ibmcloud ce project list

    Take note of the project ID you want to select then run this command to select the project:

    ibmcloud ce project select -id <project_id>
    3. Choose and deploy your desired Embeddable AI image

    To get started, simply run the following command in the terminal and choose the Watson's AI model you would like to use.

    ibmcloud cr image-list --restrict sn-labsassets

    After you execute the above command, terminal will output all the different NLP images available. You can then simply choose one of them by copying it's url. For this example, let's say you want to deploy the us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime model to Code Engine.

    Then in the same terminal, run the following commands to deploy the model:

    # Choose an app name for your Code Engine application
    APP_NAME="Replace with your Code Engine Application Name"

    # Replace with your desired Watson NLP image
    CONTAINER_IMAGE_URL="us.icr.io/sn-labsassets/sentiment-bert-watson-nlp-runtime"

    You an also set a visibility for your application, we would recommened to keep it as project to restrict any external traffic to it, and only allow the applications within your code engine project to be able to communicate with it as desired. For more infomration about visibility, check out the IBM Cloud Code Engine docs here.

    VISIBILITY=project
    ibmcloud ce application create \
    --name ${APP_NAME} \
    --env ACCEPT_LICENSE=true \
    --image ${CONTAINER_IMAGE_URL} \
    --registry-secret icr-secret \
    --visibility ${VISIBILITY}

    After the application is ready, it will display the deployed NLP service URL in the terminal. You can then utilize this service URL in the same way as the other pre-existing Watson NLP services provided by Skills Network, and directly incorporate it into any of your other applications that have been deployed to Code Engine.

+
Deploying to your personal IBM Cloud account's Code Engine

The following steps allow you to deploy the Watson NLP models to your personal IBM Cloud account's Code Engine envrionement. This deployment has some prerequisites and extra steps but ensures that your deployment is permanent untill you delete it yourself.

Prerequisites:

Ensure that you have registered for a IBM Cloud account and have enabled the billing. You can try it at no charge and receive USD$200 in cloud credits.

1. Log in to your IBM Cloud account

Using the ibmcloud login command log into your own IBM Cloud account. Remember to replace USERNAME with your IBM Cloud account email and then enter your password when promted to.

ibmcloud login -u USERNAME

Use ibmcloud login --sso command to login, if you have a federated ID.

Then target any specific resource group in your account. By default, if you've completed the sign up process for your IBM Cloud account, you can use the Default resource group.

ibmcloud target -g Default
2. Login to the IBM Entitled Registry

You'll need to login to IBM Entitled Registry to download the desired Watson NLP models so you can deploy them to your own Code Engine project.

Go IBM's Container Library to get an Entitlement Key. This Key gives you access to pulling and using the IBM Watson Speech Libraries for Embed. However, do note that this key is only valid for a Year as a trial.

Once you've obtained the Entitlement Key from the container software library you can login to the registry with the key, and pull the images.

Replace it with your own IBM Entitlement Key.

IBM_ENTITLEMENT_KEY="YOUR_IBM_ENTITLEMENT_KEY"

Login to docker registry to pull the images.

echo $IBM_ENTITLEMENT_KEY | docker login -u cp --password-stdin cp.icr.io
3. Choose and build your desired Embeddable AI image

Similar to deploying the image to Skills Network managed Code Engine, you will first need to choose a model from the model catalog.

Using the same example as above, let's say you want to deploy the sentiment_aggregated-bert-workflow_lang_multi_stock model to Code Engine.

Simply copy it's Container Image url as shown below.

Sentiment model catalog table displaying information for BERT models. The table includes columns for Model ID, Container Image, and Image Digest. The highlighted row shows the model ID as &#39;sentiment_aggregated-bert-workflow_lang_multi_stock&#39; and the container image URL as &#39;cp.icr.io/cp/ai/watson-nlp_sentiment_aggregated-bert-workflow_lang_multi_stock:1.0.9&#39;. The Image Digest column contains a long hash value.

Now simply run the following commands in a terminal to download the chosen model to models directory:

CONTAINER_IMAGE_URL="Replace with the conatiner image url for your chosen model"
mkdir models
docker run -it --rm -e ACCEPT_LICENSE=true -v `pwd`/models:/app/models ${CONTAINER_IMAGE_URL}

After this create a new file called Dockerfile and add the following contents to it:

ARG TAG=1.0
FROM cp.icr.io/cp/ai/watson-nlp-runtime:${TAG}
COPY models /app/models

Finally build your image by executing this command in your terminal:

docker build -t my-watson-nlp-runtime:latest
4 Create a namespace and log in to ICR

You will need to create a namespace before you can upload your images, and make sure you're targeting the ICR region you want, which right now is global.

Choose a name for your namespace, specified as ${NAMESPACE}, and create the namespace. Currently, it's set to my-embeddable-ai, you can choose to rename it to anything you choose.

NAMESPACE=my-embeddable-ai
ibmcloud cr region-set global
ibmcloud cr namespace-add ${NAMESPACE}
ibmcloud cr login
6. Push your image to your namespace
REGISTRY=icr.io

# Tag and push the image
docker tag my-watson-nlp-runtime:latest ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest
docker push ${REGISTRY}/${NAMESPACE}/my-watson-nlp-runtime:latest
7. Deploy the image to Code Engine

1: Target a region and a resource group

Choose the region closest to you and/or your target users. Picking a region closer to you or your users makes the browser extension faster. The further the region the longer the request to the model has to travel.

You can choose any region from this list:

Americas

  • us-south - Dallas
  • br-sao - Sao Paulo
  • ca-tor - Toronto
  • @@ -63,6 +67,35 @@

    Framework-Specific Infomation

    Flutter Web and Cloud IDE

    Flutter Web’s hot restart feature, which allows developers to see changes instantly by pressing r in the terminal, doesn’t work as expected in the Cloud IDE due to differences in the environment.

    -

    However, there’s a simple workaround with a bash script to mimic the hot reload functionality. Click here for more information on how to use this workaround.

+

However, there’s a simple workaround with a bash script to mimic the hot reload functionality. Click here for more information on how to use this workaround.

+

Tips on Writing a Successful Cloud IDE Lab

+

Creating an effective Cloud IDE lab requires careful planning to ensure learners have a smooth and engaging experience. Below are key tips to enhance the structure and learning outcomes of your lab.

+

1. Provide an overview of the final application early

+

If your lab involves building an application, include an overview within the first few pages. This helps learners understand the end goal and visualize what they will achieve by the end of the lab.

+

An overview of AI NutriCoach app interface displaying an image-based nutritional analysis tool. The interface includes an &#39;Upload Image&#39; section where users can upload a food image. There are options for entering dietary restrictions and selecting a workflow type (recipe or analysis). The results section provides a nutritional breakdown of the dish, including estimated calories and macronutrient content. A table on the right side lists example images, dietary restrictions, and workflow types.

+
Example - AI NutriCoach App Overview
+

2. Include a "Tips for the best experience" page

+

Early in the lab, provide a dedicated "Tips for the best experience" page to help learners navigate the tutorial smoothly. This page should serve as a reference point for troubleshooting and best practices throughout the lab. Key elements to include:

+
    +
  • Guidance on Navigation – Explain how to use the Table of Contents to quickly find sections and avoid getting lost.
  • +
  • Quick Start Option – Offer a fast-track method for learners who want to see the final result early.
  • +
  • Cloud IDE Best Practices – Cover essential tips such as saving work, running code blocks, and ensuring the correct project directory.
  • +
  • Application Execution Instructions – Provide reminders on keeping app.py running, using the correct port, and refreshing the application when needed.
  • +
  • Troubleshooting Tips – Include solutions for common issues like server errors, unstable models, or access problems.
  • +
+

This page acts as a go-to cheat sheet that learners can refer back to whenever they encounter confusion or errors.

+

Screenshot of the &#39;Tips for the Best Experience - Please Read!&#39; page in a tutorial. The page provides guidance on following a quick version of the tutorial, using the Table of Contents for navigation, and saving work. A highlighted red box emphasizes the Table of Contents icon in the top left corner, showing a dropdown menu with a list of tutorial sections. Additional tips on saving work and retrieving updated scripts at the end of each section are also visible.

+
Example - Tips for best experience
+

3. Offer two learning versions

+

To accommodate different learning styles and time constraints, provide two options:

+
    +
  • Quick version: Guide learners to get the final application up and running within the first few pages. This helps those who want quick results. +Screenshot of the &#39;Quick version - run the final app&#39; page in a tutorial. The page provides a step-by-step guide to quickly setting up and running the NutriCoach application. It includes three main steps: cloning the GitHub repository, setting up a Python virtual environment, and installing required libraries. The page emphasizes that this section is for users who want to get the final app running immediately, with a disclaimer advising others to skip ahead for the full tutorial. Code snippets with run buttons are included for ease of execution.
  • +
+
Example - Quick version
+
    +
  • Full version: Once the application is running, encourage learners to continue through the rest of the lab to explore deeper explanations, code breakdowns, and additional insights.
  • +
+

By structuring your Cloud IDE lab in this way, you can cater to both quick learners who want a fast setup and those who prefer an in-depth understanding of the implementation.

\ No newline at end of file diff --git a/labs/tools/introduction/index.html b/labs/tools/introduction/index.html index d204a81..01d0c53 100644 --- a/labs/tools/introduction/index.html +++ b/labs/tools/introduction/index.html @@ -4,7 +4,7 @@ Introduction | Skills Network Knowledge Base - + diff --git a/labs/tools/jupyterlab/index.html b/labs/tools/jupyterlab/index.html index 6d66a55..37be197 100644 --- a/labs/tools/jupyterlab/index.html +++ b/labs/tools/jupyterlab/index.html @@ -4,7 +4,7 @@ JupyterLab | Skills Network Knowledge Base - + diff --git a/labs/tools/jupyterlite/index.html b/labs/tools/jupyterlite/index.html index 52534c1..b5e70b6 100644 --- a/labs/tools/jupyterlite/index.html +++ b/labs/tools/jupyterlite/index.html @@ -4,7 +4,7 @@ JupyterLite | Skills Network Knowledge Base - + diff --git a/labs/upgrade-jupyterlab/index.html b/labs/upgrade-jupyterlab/index.html index cc9d293..cea839a 100644 --- a/labs/upgrade-jupyterlab/index.html +++ b/labs/upgrade-jupyterlab/index.html @@ -4,7 +4,7 @@ Upgrading to the Latest Version of JupyterLab | Skills Network Knowledge Base - +