Skip to content
Snippets Groups Projects
Commit d1b5d5ed authored by yangalicace1's avatar yangalicace1
Browse files

Deployed c67cd413 to develop in public with MkDocs 1.6.1 and mike 2.1.3

parent 0f07b969
No related branches found
No related tags found
No related merge requests found
...@@ -567,8 +567,7 @@ sudo apt-get dist-upgrade -y ...@@ -567,8 +567,7 @@ sudo apt-get dist-upgrade -y
</code></pre> </code></pre>
<h3><u>Install PyEnv</h3> <h3><u>Install PyEnv</h3>
<p></u></p> <p></u></p>
<p>We recommend installing PyEnv through<br /> <p>We recommend installing PyEnv through <a href="https://github.com/pyenv/pyenv-installer">PyEnv Installer</a>.
<a href="https://github.com/pyenv/pyenv-installer">PyEnv Installer</a>.
Below you can find the instructions, but we refer you to the link for updated Below you can find the instructions, but we refer you to the link for updated
instructions.</p> instructions.</p>
<pre><code class="language-bash">curl https://pyenv.run | bash <pre><code class="language-bash">curl https://pyenv.run | bash
...@@ -691,7 +690,7 @@ In the root directory of the existing Java components you will find an executabl ...@@ -691,7 +690,7 @@ In the root directory of the existing Java components you will find an executabl
<p></u> <p></u>
In case you are using <a href="https://code.visualstudio.com/">VS Code</a> for development, we suggest to install the <a href="https://marketplace.visualstudio.com/items?itemName=redhat.vscode-quarkus">official Quarkus extension</a>. In case you are using <a href="https://code.visualstudio.com/">VS Code</a> for development, we suggest to install the <a href="https://marketplace.visualstudio.com/items?itemName=redhat.vscode-quarkus">official Quarkus extension</a>.
The extension should be able to automatically find the current open project and integrate with the above <code>mvnw</code> maven wrapper, making it easier to control the <a href="https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html">maven lifecycle</a>. The extension should be able to automatically find the current open project and integrate with the above <code>mvnw</code> maven wrapper, making it easier to control the <a href="https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html">maven lifecycle</a>.
Make sure that you open the specific component directory (i.e., <code>src/ztp</code> or <code>src/policy</code>) and not the general controller one (i.e., <code>src</code>.</p> Make sure that you open the specific component directory (i.e., <code>src/ztp</code> or <code>src/policy</code>) and not the general controller one (i.e., <code>src</code>.)</p>
<h3><u>New Java TFS component</h3> <h3><u>New Java TFS component</h3>
<p></u></p> <p></u></p>
<p><strong>Sample Project</strong></p> <p><strong>Sample Project</strong></p>
...@@ -719,64 +718,70 @@ develop code for the ETSI TeraFlowSDN controller.</p> ...@@ -719,64 +718,70 @@ develop code for the ETSI TeraFlowSDN controller.</p>
using <a href="https://asdf-vm.com/">ASDF</a>, a tool that allows the installation of multiple using <a href="https://asdf-vm.com/">ASDF</a>, a tool that allows the installation of multiple
version of Erlang at the same time, and switch from one version to the other at will.</p> version of Erlang at the same time, and switch from one version to the other at will.</p>
<ul> <ul>
<li>First, install any missing dependencies:</li> <li>
</ul> <p>First, install any missing dependencies:
<pre><code class="language-bash">sudo apt install curl git autoconf libncurses-dev build-essential m4 libssl-dev <code>bash
</code></pre> sudo apt install curl git autoconf libncurses-dev build-essential m4 libssl-dev</code></p>
<ul> </li>
<li>Download <em>ASDF</em> tool to the local account:</li> <li>
</ul> <p>Download <em>ASDF</em> tool to the local account:
<pre><code class="language-bash">git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2 <code>bash
</code></pre> git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2</code></p>
<ul> </li>
<li>Make <em>ASDF</em> activate on login by adding these lines at the end of the <code>~/.bashrc</code> file:</li> <li>
</ul> <p>Make <em>ASDF</em> activate on login by adding these lines at the end of the <code>~/.bashrc</code> file:
<pre><code class="language-bash">. $HOME/.asdf/asdf.sh <code>bash
. $HOME/.asdf/completions/asdf.bash . $HOME/.asdf/asdf.sh
</code></pre> . $HOME/.asdf/completions/asdf.bash</code></p>
<ul> </li>
<li>Logout and log back in to activate <em>ASDF</em>.</li> <li>
<p>Logout and log back in to activate <em>ASDF</em>.</p>
</li>
</ul> </ul>
<p><em>ASDF</em> supports multiple tools by installing there corresponding plugins.</p> <p><em>ASDF</em> supports multiple tools by installing there corresponding plugins.</p>
<ul> <ul>
<li>Install <em>ASDF</em> plugin for Erlang:</li> <li>
</ul> <p>Install <em>ASDF</em> plugin for Erlang:
<pre><code class="language-bash">asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git <code>bash
</code></pre> asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git</code></p>
<ul> </li>
<li>Install a version of Erlang:</li> <li>
</ul> <p>Install a version of Erlang:
<pre><code class="language-bash">asdf install erlang 24.3.4.2 <code>bash
</code></pre> asdf install erlang 24.3.4.2</code></p>
<ul> </li>
<li>Activate Erlang locally for TFS controller. This will create a local file <li>
called <code>.tool-versions</code> defining which version of the tools to use when <p>Activate Erlang locally for TFS controller. This will create a local file
running under the current directory:</li> called <code>.tool-versions</code> defining which version of the tools to use when
running under the current directory:
<code>bash
cd tfs-ctrl/
asdf local erlang 24.3.4.2</code></p>
</li>
</ul> </ul>
<pre><code class="language-bash">cd tfs-ctrl/
asdf local erlang 24.3.4.2
</code></pre>
<p>Erlang projects uses a build tool called <p>Erlang projects uses a build tool called
<a href="https://github.com/erlang/rebar3">rebar3</a>. <a href="https://github.com/erlang/rebar3">rebar3</a>.
It is used to manager project dependenecies, compile a project and generate It is used to manager project dependenecies, compile a project and generate
project releases.</p> project releases.</p>
<ul> <ul>
<li>Install rebar3 localy from source:</li> <li>
</ul> <p>Install rebar3 localy from source:
<pre><code class="language-bash">cd ~ <code>bash
git clone https://github.com/erlang/rebar3.git cd ~
cd rebar3 git clone https://github.com/erlang/rebar3.git
asdf local erlang 24.3.4.2 cd rebar3
./bootstrap asdf local erlang 24.3.4.2
./rebar3 local install ./bootstrap
</code></pre> ./rebar3 local install</code></p>
<ul> </li>
<li>Update <code>~/.bashrc</code> to use rebar3 by adding this line at the end:</li> <li>
</ul> <p>Update <code>~/.bashrc</code> to use rebar3 by adding this line at the end:
<pre><code class="language-bash">export PATH=$HOME/.cache/rebar3/bin:$PATH <code>bash
</code></pre> export PATH=$HOME/.cache/rebar3/bin:$PATH</code></p>
<ul> </li>
<li>Logout and log back in.</li> <li>
<p>Logout and log back in.</p>
</li>
</ul> </ul>
<h3 id="216-kotlin"><strong>2.1.6. Kotlin</strong></h3> <h3 id="216-kotlin"><strong>2.1.6. Kotlin</strong></h3>
<p>This section describes the steps needed to establish a development environment for TFS (TeraFlowSDN) components implemented in Kotlin. Currently, the <code>Gateway</code> component stands as the sole component developed in Kotlin.</p> <p>This section describes the steps needed to establish a development environment for TFS (TeraFlowSDN) components implemented in Kotlin. Currently, the <code>Gateway</code> component stands as the sole component developed in Kotlin.</p>
...@@ -890,10 +895,12 @@ machine, not in the VM.</p> ...@@ -890,10 +895,12 @@ machine, not in the VM.</p>
<ul> <ul>
<li>Right-click on "TFS-VM"</li> <li>Right-click on "TFS-VM"</li>
<li>Select "Connect to Host in Current Window"</li> <li>Select "Connect to Host in Current Window"</li>
<li>Reply to the questions asked</li> <li>Reply to the questions asked<ul>
<li>Platform of the remote host "TFS-VM": Linux</li> <li>Platform of the remote host "TFS-VM": Linux</li>
<li>"TFS-VM" has fingerprint "<fingerprint>". Do you want to continue?: Continue</li> <li>"TFS-VM" has fingerprint "<fingerprint>". Do you want to continue?: Continue</li>
<li>Type tfs user's password: tfs123</li> <li>Type tfs user's password: tfs123</li>
</ul>
</li>
<li>You should be now connected to the TFS-VM.</li> <li>You should be now connected to the TFS-VM.</li>
</ul> </ul>
<p><strong>Note</strong>: if you get a connection error message, the reason might be due to wrong SSH server fingerprint. Edit file <p><strong>Note</strong>: if you get a connection error message, the reason might be due to wrong SSH server fingerprint. Edit file
...@@ -901,50 +908,55 @@ machine, not in the VM.</p> ...@@ -901,50 +908,55 @@ machine, not in the VM.</p>
"[127.0.0.1]:2200" (assuming previous port forwarding configuration), remove the entire line, save the file, "[127.0.0.1]:2200" (assuming previous port forwarding configuration), remove the entire line, save the file,
and retry connection.</p> and retry connection.</p>
<h3><u>Add SSH key to prevent typing the password every time</h3> <h3><u>Add SSH key to prevent typing the password every time</h3>
<p></u> <p></u></p>
This step creates an SSH key in the VM and installs it on the VSCode to prevent having to type the password every time.</p> <p>This step creates an SSH key in the VM and installs it on the VSCode to prevent having to type the password every time.</p>
<ul> <ul>
<li>In VSCode (connected to the VM), click menu "Terminal &gt; New Terminal"</li> <li>In VSCode (connected to the VM), click menu "Terminal &gt; New Terminal"</li>
<li>Run the following commands on the VM's terminal through VSCode</li> <li>
</ul> <p>Run the following commands on the VM's terminal through VSCode
<pre><code class="language-bash">ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key <code>bash
# leave password empty ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key
ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10 # leave password empty
# tfs@10.0.2.10's password: &lt;type tfs user's password: tfs123&gt; ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10
rm .ssh/known_hosts # tfs@10.0.2.10's password: &lt;type tfs user's password: tfs123&gt;
</code></pre> rm .ssh/known_hosts</code></p>
</li>
<li>
<p>In VSCode, click left "Explorer" panel to expand, if not expanded, and click "Open Folder" button.</p>
<ul> <ul>
<li>In VSCode, click left "Explorer" panel to expand, if not expanded, and click "Open Folder" button.</li>
<li>Choose "/home/tfs/"</li> <li>Choose "/home/tfs/"</li>
<li>Type tfs user's password when asked</li> <li>Type tfs user's password when asked</li>
<li>Trust authors of the "/home/tfs [SSH: TFS-VM]" folder when asked</li> <li>Trust authors of the "/home/tfs [SSH: TFS-VM]" folder when asked</li>
<li>Right click on the file "tfs-vm.key" in the file explorer</li> </ul>
</li>
<li>Right click on the file "tfs-vm.key" in the file explorer<ul>
<li>Select "Download..." option</li> <li>Select "Download..." option</li>
<li>Download the file into your user's accout ".ssh" folder</li> <li>Download the file into your user's accout ".ssh" folder</li>
</ul>
</li>
<li> <li>
<p>Delete files "tfs-vm.key" and "tfs-vm.key.pub" on the TFS-VM.</p> <p>Delete files "tfs-vm.key" and "tfs-vm.key.pub" on the TFS-VM.</p>
</li> </li>
<li> <li>
<p>In VSCode, click left "Remote Explorer" panel to expand</p> <p>In VSCode, click left "Remote Explorer" panel to expand</p>
</li> <ul>
<li>Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar</li> <li>Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar</li>
<li>Choose to edit "&lt;...&gt;/.ssh/config" file (or equivalent)</li> <li>Choose to edit "&lt;...&gt;/.ssh/config" file (or equivalent)</li>
<li>Find entry "Host TFS-VM" and update it as follows:</li> <li>Find entry "Host TFS-VM" and update it as follows:
</ul> <code>Host TFS-VM
<pre><code>Host TFS-VM HostName 127.0.0.1
HostName 127.0.0.1 Port 2200
Port 2200 ForwardX11 no
ForwardX11 no User tfs
User tfs IdentityFile "&lt;path to the downloaded identity private key file&gt;"</code></li>
IdentityFile &quot;&lt;path to the downloaded identity private key file&gt;&quot;
</code></pre>
<ul>
<li>Save the file</li> <li>Save the file</li>
</ul>
</li>
<li>From now, VSCode will use the identity file to connect to the TFS-VM instead of the user's password.</li> <li>From now, VSCode will use the identity file to connect to the TFS-VM instead of the user's password.</li>
</ul> </ul>
<h3><u>Install VSCode Python Extension (in VSCode server)</h3> <h3><u>Install VSCode Python Extension (in VSCode server)</h3>
<p></u> <p></u></p>
This step installs Python extensions in VSCode server running in the VM.</p> <p>This step installs Python extensions in VSCode server running in the VM.</p>
<ul> <ul>
<li>In VSCode (connected to the VM), click left button "Extensions"</li> <li>In VSCode (connected to the VM), click left button "Extensions"</li>
<li>Search "Python" extension in the extension Marketplace.</li> <li>Search "Python" extension in the extension Marketplace.</li>
...@@ -960,8 +972,8 @@ This step installs Python extensions in VSCode server running in the VM.</p> ...@@ -960,8 +972,8 @@ This step installs Python extensions in VSCode server running in the VM.</p>
<li>Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')"</li> <li>Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')"</li>
</ul> </ul>
<h3><u>Define environment variables for VSCode</h3> <h3><u>Define environment variables for VSCode</h3>
<p></u> <p></u></p>
The source code in the TFS controller project is hosted in folder <code>src/</code>. To help VSCode find the Python modules and <p>The source code in the TFS controller project is hosted in folder <code>src/</code>. To help VSCode find the Python modules and
packages, add the following file into your working space root folder:</p> packages, add the following file into your working space root folder:</p>
<pre><code class="language-bash">echo &quot;PYTHONPATH=./src&quot; &gt;&gt; ~/tfs-ctrl/.env <pre><code class="language-bash">echo &quot;PYTHONPATH=./src&quot; &gt;&gt; ~/tfs-ctrl/.env
</code></pre> </code></pre>
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment