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
</code></pre>
<h3><u>Install PyEnv</h3>
<p></u></p>
<p>We recommend installing PyEnv through<br />
<a href="https://github.com/pyenv/pyenv-installer">PyEnv Installer</a>.
<p>We recommend installing PyEnv through <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
instructions.</p>
<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
<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>.
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>
<p></u></p>
<p><strong>Sample Project</strong></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
version of Erlang at the same time, and switch from one version to the other at will.</p>
<ul>
<li>First, install any missing dependencies:</li>
</ul>
<pre><code class="language-bash">sudo apt install curl git autoconf libncurses-dev build-essential m4 libssl-dev
</code></pre>
<ul>
<li>Download <em>ASDF</em> tool to the local account:</li>
</ul>
<pre><code class="language-bash">git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
</code></pre>
<ul>
<li>Make <em>ASDF</em> activate on login by adding these lines at the end of the <code>~/.bashrc</code> file:</li>
</ul>
<pre><code class="language-bash">. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
</code></pre>
<ul>
<li>Logout and log back in to activate <em>ASDF</em>.</li>
<li>
<p>First, install any missing dependencies:
<code>bash
sudo apt install curl git autoconf libncurses-dev build-essential m4 libssl-dev</code></p>
</li>
<li>
<p>Download <em>ASDF</em> tool to the local account:
<code>bash
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2</code></p>
</li>
<li>
<p>Make <em>ASDF</em> activate on login by adding these lines at the end of the <code>~/.bashrc</code> file:
<code>bash
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash</code></p>
</li>
<li>
<p>Logout and log back in to activate <em>ASDF</em>.</p>
</li>
</ul>
<p><em>ASDF</em> supports multiple tools by installing there corresponding plugins.</p>
<ul>
<li>Install <em>ASDF</em> plugin for Erlang:</li>
</ul>
<pre><code class="language-bash">asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
</code></pre>
<ul>
<li>Install a version of Erlang:</li>
</ul>
<pre><code class="language-bash">asdf install erlang 24.3.4.2
</code></pre>
<ul>
<li>Activate Erlang locally for TFS controller. This will create a local file
called <code>.tool-versions</code> defining which version of the tools to use when
running under the current directory:</li>
<li>
<p>Install <em>ASDF</em> plugin for Erlang:
<code>bash
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git</code></p>
</li>
<li>
<p>Install a version of Erlang:
<code>bash
asdf install erlang 24.3.4.2</code></p>
</li>
<li>
<p>Activate Erlang locally for TFS controller. This will create a local file
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>
<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
<a href="https://github.com/erlang/rebar3">rebar3</a>.
It is used to manager project dependenecies, compile a project and generate
project releases.</p>
<ul>
<li>Install rebar3 localy from source:</li>
</ul>
<pre><code class="language-bash">cd ~
git clone https://github.com/erlang/rebar3.git
cd rebar3
asdf local erlang 24.3.4.2
./bootstrap
./rebar3 local install
</code></pre>
<ul>
<li>Update <code>~/.bashrc</code> to use rebar3 by adding this line at the end:</li>
</ul>
<pre><code class="language-bash">export PATH=$HOME/.cache/rebar3/bin:$PATH
</code></pre>
<ul>
<li>Logout and log back in.</li>
<li>
<p>Install rebar3 localy from source:
<code>bash
cd ~
git clone https://github.com/erlang/rebar3.git
cd rebar3
asdf local erlang 24.3.4.2
./bootstrap
./rebar3 local install</code></p>
</li>
<li>
<p>Update <code>~/.bashrc</code> to use rebar3 by adding this line at the end:
<code>bash
export PATH=$HOME/.cache/rebar3/bin:$PATH</code></p>
</li>
<li>
<p>Logout and log back in.</p>
</li>
</ul>
<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>
......@@ -890,10 +895,12 @@ machine, not in the VM.</p>
<ul>
<li>Right-click on "TFS-VM"</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>"TFS-VM" has fingerprint "<fingerprint>". Do you want to continue?: Continue</li>
<li>Type tfs user's password: tfs123</li>
</ul>
</li>
<li>You should be now connected to the TFS-VM.</li>
</ul>
<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>
"[127.0.0.1]:2200" (assuming previous port forwarding configuration), remove the entire line, save the file,
and retry connection.</p>
<h3><u>Add SSH key to prevent typing the password every time</h3>
<p></u>
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></u></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>
<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>
</ul>
<pre><code class="language-bash">ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key
# leave password empty
ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10
# tfs@10.0.2.10's password: &lt;type tfs user's password: tfs123&gt;
rm .ssh/known_hosts
</code></pre>
<li>
<p>Run the following commands on the VM's terminal through VSCode
<code>bash
ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key
# leave password empty
ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10
# tfs@10.0.2.10's password: &lt;type tfs user's password: tfs123&gt;
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>
<li>In VSCode, click left "Explorer" panel to expand, if not expanded, and click "Open Folder" button.</li>
<li>Choose "/home/tfs/"</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>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>Download the file into your user's accout ".ssh" folder</li>
</ul>
</li>
<li>
<p>Delete files "tfs-vm.key" and "tfs-vm.key.pub" on the TFS-VM.</p>
</li>
<li>
<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>Choose to edit "&lt;...&gt;/.ssh/config" file (or equivalent)</li>
<li>Find entry "Host TFS-VM" and update it as follows:</li>
</ul>
<pre><code>Host TFS-VM
HostName 127.0.0.1
Port 2200
ForwardX11 no
User tfs
IdentityFile &quot;&lt;path to the downloaded identity private key file&gt;&quot;
</code></pre>
<ul>
<li>Find entry "Host TFS-VM" and update it as follows:
<code>Host TFS-VM
HostName 127.0.0.1
Port 2200
ForwardX11 no
User tfs
IdentityFile "&lt;path to the downloaded identity private key file&gt;"</code></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>
</ul>
<h3><u>Install VSCode Python Extension (in VSCode server)</h3>
<p></u>
This step installs Python extensions in VSCode server running in the VM.</p>
<p></u></p>
<p>This step installs Python extensions in VSCode server running in the VM.</p>
<ul>
<li>In VSCode (connected to the VM), click left button "Extensions"</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>
<li>Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')"</li>
</ul>
<h3><u>Define environment variables for VSCode</h3>
<p></u>
The source code in the TFS controller project is hosted in folder <code>src/</code>. To help VSCode find the Python modules and
<p></u></p>
<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>
<pre><code class="language-bash">echo &quot;PYTHONPATH=./src&quot; &gt;&gt; ~/tfs-ctrl/.env
</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