Skip to content

Commit

Permalink
[CI] Publish Documentation for 7e7cdca - 7e7cdca 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofthejars committed Oct 11, 2024
1 parent a0a8080 commit c654fd6
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 284 deletions.
265 changes: 30 additions & 235 deletions instructlab-tutorial/01-setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,266 +102,61 @@ <h1 class="page">Setup</h1>
<h2 id="prerequisite"><a class="anchor" href="#prerequisite"></a>Prerequisite CLI tools</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The following CLI tools are required for running the exercises in this tutorial.
Please have them installed and configured before you get started with any of the tutorial chapters.</p>
<p>For this deep dive you need the <code>ilab</code> CLI tool installed.
It handles the main tuning workflow.
Currently, it supports Linux systems and Apple/Silicon Macs (M1/M2/M3), as well as Windows with WSL2.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-center valign-top"><strong>Tool</strong></th>
<th class="tableblock halign-center valign-top"><strong>macOS</strong></th>
<th class="tableblock halign-center valign-top"><strong>Fedora</strong></th>
<th class="tableblock halign-center valign-top"><strong>windows</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>Git</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://git-scm.com/download/mac">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://git-scm.com/download/linux">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://git-scm.com/download/win">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>Docker</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://docs.docker.com/docker-for-mac/install">Docker for Mac</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>dnf install docker</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://docs.docker.com/docker-for-windows/install">Docker for Windows</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>VirtualBox</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://download.virtualbox.org/virtualbox/6.1.6/VirtualBox-6.1.6-137129-OSX.dmg">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://www.virtualbox.org/wiki/Linux_Downloads">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://download.virtualbox.org/virtualbox/6.1.6/VirtualBox-6.1.6-137129-Win.exe">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://kubernetes.io/docs/tasks/tools/install-minikube">Minikube</a> v1.29.0</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/kubernetes/minikube/releases/download/v1.29.0/minikube-darwin-amd64">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/kubernetes/minikube/releases/download/v1.29.0/minikube-linux-amd64">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/kubernetes/minikube/releases/download/v1.29.0/minikube-windows-amd64.exe">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>kubectl v1.26.1</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://storage.googleapis.com/kubernetes-release/release/v1.26.1/bin/darwin/amd64/kubectl">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://storage.googleapis.com/kubernetes-release/release/v1.26.1/bin/linux/amd64/kubectl">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://storage.googleapis.com/kubernetes-release/release/v1.26.1/bin/windows/amd64/kubectl.exe">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/wercker/stern">stern</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>brew install stern</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/stern/stern/releases/download/v1.22.0/stern_1.22.0_linux_amd64.tar.gz">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/stern/stern/releases/download/v1.22.0/stern_1.22.0_windows_amd64.tar.gz">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>Apache Maven 3.9.0</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://archive.apache.org/dist/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.tar.gz">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://archive.apache.org/dist/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.tar.gz">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://archive.apache.org/dist/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.tar.gz">Download</a></p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>The following CLI tools are optional for running the exercises in this tutorial.
Although they are used in the tutorial, you could use others without any problem.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-center valign-top"><strong>Tool</strong></th>
<th class="tableblock halign-center valign-top"><strong>macOS</strong></th>
<th class="tableblock halign-center valign-top"><strong>Fedora</strong></th>
<th class="tableblock halign-center valign-top"><strong>windows</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/mikefarah/yq">yq v2.4.1</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/mikefarah/yq/releases/download/2.4.1/yq_darwin_amd64">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/mikefarah/yq/releases/download/2.4.1/yq_linux_amd64">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/mikefarah/yq/releases/download/2.4.1/yq_windows_amd64.exe">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/stedolan/jq">jq v1.6.0</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe">Download</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://httpie.org/">httpie</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>brew install httpie</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>dnf install httpie</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://httpie.org/doc#windows-etc" class="bare">https://httpie.org/doc#windows-etc</a></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock">watch</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>brew install watch</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>dnf install procps-ng</code></p></td>
<td class="tableblock halign-center valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock">kubectx and kubens</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>brew install kubectx</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/ahmetb/kubectx" class="bare">https://github.com/ahmetb/kubectx</a></p></td>
<td class="tableblock halign-center valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://github.com/rakyll/hey">hey</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><code>brew install hey</code></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://storage.googleapis.com/jblabs/dist/hey_linux_v0.1.2">Download</a></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><a href="https://hey-release.s3.us-east-2.amazonaws.com/hey_windows_amd64">Download</a></p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="minikube"><a class="anchor" href="#minikube"></a>Setup Kubernetes</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The profile my_profile is created to run the tutorial:</p>
<p>The installation instructions are different depending on your operative system and/or if you want to use <code>ilab</code> with or without GPU.</p>
</div>
<div class="tabset is-loading">
<div class="ulist tabs">
<ul>
<li>
<p><a id="tabset1_minikube"></a>Minikube</p>
</li>
<li>
<p><a id="tabset1_openshift"></a>OpenShift</p>
</li>
</ul>
</div>
<div class="content">
<div class="tab-pane" aria-labelledby="tabset1_minikube">
<div class="paragraph">
<p>Having <code>minikube</code> installed and in your <code>PATH</code>, then run:</p>
</div>
<div class="paragraph">
<p><strong>MacOS</strong></p>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">minikube start --memory=8192 --cpus=3 --kubernetes-version=v1.26.1 --vm-driver=virtualbox -p my_profile</code></pre>
</div>
<p>Moreover, you install InstructLab CLI using Python (as it is the easiest way), and you might use tools like <code>pyenv</code> to isolate the installation.</p>
</div>
<div class="paragraph">
<p><strong>Linux</strong></p>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">minikube start --memory=8192 --cpus=3 --kubernetes-version=v1.26.1 --vm-driver=kvm2 -p my_profile</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Windows:</strong></p>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">minikube start --memory=8192 --cpus=3 --kubernetes-version=v1.26.1 --vm-driver=hyperv -p my_profile</code></pre>
</div>
</div>
<div class="paragraph">
<p>And the output must be something similar like:</p>
</div>
<div class="listingblock console-output">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">😄 [my_profile] minikube v1.20.0 on Darwin 11.3
✅ Created a new profile : my_profile
✅ minikube profile was successfully set to my_profile
😄 [default] minikube v1.29.0 on Darwin 11.3
✨ Selecting 'virtualbox' driver from user configuration (alternates: [hyperkit])
🔥 Creating virtualbox VM (CPUs=2, Memory=8192MB, Disk=50000MB) ...
🐳 Preparing Kubernetes v1.26.1 on Docker '20.10.6' ...
▪ apiserver.enable-admission-plugins=LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook
🚜 Pulling images ...
🚀 Launching Kubernetes ...
⌛ Waiting for cluster to come online ...
🏄 Done! kubectl is now configured to use "my_profile"</code></pre>
<p>For this reason, we recommend you take a look at <a href="https://github.com/instructlab/instructlab?tab=readme-ov-file#-installing-ilab">Installing ilab</a> and install ilab in the more convenient.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
At this time you need to use Python 3.10 or 3.11, not any other Python version is supported.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Finally configure to use minikube internal docker as docker host:</p>
<p>The following snippet shows the installation in a Apple Mac:</p>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">eval $(minikube docker-env -p my_profile)</code></pre>
</div>
</div>
</div>
<div class="tab-pane" aria-labelledby="tabset1_openshift">
<div class="paragraph">
<p>To run OpenShift4, you need to have one provisioned using <a href="https://try.openshift.com">try.openshift.com</a> or can use any existing OpenShift4 cluster.
Once you have your cluster, you can download the latest OpenShift client(oc) from <a href="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/">here</a> and add to your path.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>oc version</pre>
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">mkdir instructlab &amp;&amp; cd instructlab

python3 -m venv --upgrade-deps venv
source venv/bin/activate

pip cache remove llama_cpp_python

pip install 'instructlab[mps]==0.19.3'</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can check the OpenShift version using:</p>
<p>To check if <code>ilab</code> is installed correctly run the following command:</p>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc version</code></pre>
</div>
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">ilab --version</code></pre>
</div>
<div class="paragraph">
<p>The output should show oc version &gt;=4.7:</p>
</div>
<div class="listingblock console-output">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Client Version: 4.7.0-202102130115.p0-c66c03f
Kubernetes Version: v1.26.1</code></pre>
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">ilab, version 0.19.3</code></pre>
</div>
</div>
<div class="paragraph">
<p>Then login into the OpenShift cluster using <code>oc login</code></p>
</div>
</div>
</div>
</div>
<div class="paragraph">
<p>And then you are ready for start using Kubernetes:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/kubelogo.png" alt="kubelogo">
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="downloadtutorial"><a class="anchor" href="#downloadtutorial"></a>Get tutorial sources</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before we start setting up the environment, let’s clone the tutorial sources and set the <code>TUTORIAL_HOME</code> environment variable to point to the root directory of the tutorial:</p>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">git clone <a href="https://github.com/redhat-developer-demos/rhd-tutorial-common.git" class="bare">https://github.com/redhat-developer-demos/rhd-tutorial-common.git</a> my_folder</code></pre>
</div>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">export TUTORIAL_HOME="$(pwd)/my_folder"</code></pre>
</div>
</div>
<div class="listingblock console-input">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">cd $TUTORIAL_HOME</code></pre>
</div>
<p>You should see the <code>ilab</code> version printed, at this time <code>version 0.19.3</code>.</p>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit c654fd6

Please sign in to comment.