
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://bdereims.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://bdereims.github.io/" rel="alternate" type="text/html" /><updated>2022-09-02T10:56:53+00:00</updated><id>https://bdereims.github.io/feed.xml</id><title type="html">bdereims’ hacks</title><subtitle>This is my personal blog which references all my hacks. Use as is without any warranty. If there are typos and disclosing information, let me know.</subtitle><entry><title type="html">OCI - one more Cloud</title><link href="https://bdereims.github.io/oracle/2022/09/02/oci.html" rel="alternate" type="text/html" title="OCI - one more Cloud" /><published>2022-09-02T08:00:00+00:00</published><updated>2022-09-02T08:00:00+00:00</updated><id>https://bdereims.github.io/oracle/2022/09/02/oci</id><content type="html" xml:base="https://bdereims.github.io/oracle/2022/09/02/oci.html">&lt;p&gt;For an interne project I have to use &lt;a href=&quot;https://www.oracle.com/cloud/&quot;&gt;Oracle Cloud Infrastructure&lt;/a&gt;. I was very skeptical about it and I’m wondering why OCI?
Anyway, it was time to discover what it is and automate things to avoid to do again boring tasks.
Today there are so many Infrastructure as Code solutions (pulumi, terraform and others) but it always good to go with  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;The Hard Way&lt;/code&gt; to discover a solution. This is why I decided to write some bash scripts executing &lt;a href=&quot;https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cliconcepts.htm&quot;&gt;oci cli&lt;/a&gt; commands covering my needs:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;create a compartment, it’s like a tenant&lt;/li&gt;
  &lt;li&gt;create VCN, like a VPC&lt;/li&gt;
  &lt;li&gt;create Public &amp;amp; Private Subnets&lt;/li&gt;
  &lt;li&gt;create internet gateway&lt;/li&gt;
  &lt;li&gt;create ingress firewall rules&lt;/li&gt;
  &lt;li&gt;create instance of my Linux sixty9 jumpBox, configure iptables, wireguard VPN and DNS&lt;/li&gt;
  &lt;li&gt;possibility to deploy VMs as master/worker kubernetes nodes and bare metal worker kubernetes node with GPU in same VCN&lt;/li&gt;
  &lt;li&gt;use kubespray to setup kubernetes from sixty9&lt;/li&gt;
  &lt;li&gt;obviously destroy all the things&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These scripts give me flexibility to test things, to add nodes when it’s needed. A perfect use case for me. I share it with you in a &lt;a href=&quot;https://github.com/bdereims/cloud-garage/tree/main/install/oci&quot;&gt;git repo&lt;/a&gt; a subpart of &lt;a href=&quot;https://github.com/bdereims/cloud-garage/tree/main/install&quot;&gt;cloud-garage&lt;/a&gt; repo.&lt;/p&gt;

&lt;p&gt;OCI portal:
&lt;img src=&quot;/gfx/oci-instances.png&quot; alt=&quot;OCI Portal&quot; /&gt;&lt;/p&gt;

&lt;p&gt;VCN configuration:
&lt;img src=&quot;/gfx/oci-vcn.png&quot; alt=&quot;VCN&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With wireguard, I can directly interact with kubernetes from my laptop without exposing it publicly:
&lt;img src=&quot;/gfx/oci-kubectl.png&quot; alt=&quot;VCN&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Finally OCI is an excellent solution. I don’t regret discovering Oracle Cloud Infrastructure.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;</content><author><name></name></author><category term="oracle" /><summary type="html">For an interne project I have to use Oracle Cloud Infrastructure. I was very skeptical about it and I’m wondering why OCI? Anyway, it was time to discover what it is and automate things to avoid to do again boring tasks. Today there are so many Infrastructure as Code solutions (pulumi, terraform and others) but it always good to go with The Hard Way to discover a solution. This is why I decided to write some bash scripts executing oci cli commands covering my needs: create a compartment, it’s like a tenant create VCN, like a VPC create Public &amp;amp; Private Subnets create internet gateway create ingress firewall rules create instance of my Linux sixty9 jumpBox, configure iptables, wireguard VPN and DNS possibility to deploy VMs as master/worker kubernetes nodes and bare metal worker kubernetes node with GPU in same VCN use kubespray to setup kubernetes from sixty9 obviously destroy all the things</summary></entry><entry><title type="html">Run NGC container in Windows 11</title><link href="https://bdereims.github.io/ia/2022/07/21/ngc-container-wsl.html" rel="alternate" type="text/html" title="Run NGC container in Windows 11" /><published>2022-07-21T13:37:15+00:00</published><updated>2022-07-21T13:37:15+00:00</updated><id>https://bdereims.github.io/ia/2022/07/21/ngc-container-wsl</id><content type="html" xml:base="https://bdereims.github.io/ia/2022/07/21/ngc-container-wsl.html">&lt;p&gt;I’m a big server Linux fan and have used laptop macOS for over 10 years now for its unix like shell. Windows has now the famous Windows Subsystem for Linux, time to give it a shot! Furthermore, I want also escape Docker Desktop fees… Let’s try something fancy.&lt;/p&gt;

&lt;p&gt;First step is to activate WSL on your Win11 box. So, to do that you need to enable 2 features like below:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/gfx/activate-wsl.png&quot; alt=&quot;win11-wsl&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Followed in command prompt: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wsl --install --distribution Ubuntu-20.04&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To run containers, we need to install podman. It’s a free open source docker engine alternative. If you hope to use docker-ce in wsl you wrong, it needs Docker Desktop that is not free if you’re working for large enterprise.&lt;/p&gt;

&lt;p&gt;Within WSL shell:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# source /etc/os-release
# sh -c &quot;echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' &amp;gt; /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list&quot;
# wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | apt-key add -
# apt-get update -qq -y
# apt-get -qq --yes install podman
# podman version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You should get:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/gfx/podam-version.png&quot; alt=&quot;podman-version&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You have to set default registry: 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# echo 'unqualified-search-registries = [&quot;docker.io&quot;]' | sudo tee /etc/containers/registries.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Verify that nvidia driver is working propely: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# nvidia-smi&lt;/code&gt;, you should get something like:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/gfx/nvidia-smi-win11.png&quot; alt=&quot;nvidia-smi&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Install &lt;a href=&quot;https://github.com/henrymai/podman_wsl2_cuda_rootless&quot;&gt;nvidia-container-toolkit&lt;/a&gt; (cf. https://github.com/henrymai/podman_wsl2_cuda_rootless )&lt;/p&gt;

&lt;p&gt;Modify file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/nvidia-container-runtime/config.toml&lt;/code&gt; like this:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;disable-require = false
#swarm-resource = &quot;DOCKER_RESOURCE_GPU&quot;
#accept-nvidia-visible-devices-envvar-when-unprivileged = true
#accept-nvidia-visible-devices-as-volume-mounts = false

[nvidia-container-cli]
#root = &quot;/run/nvidia/driver&quot;
#path = &quot;/usr/bin/nvidia-container-cli&quot;
environment = []
#debug = &quot;/var/log/nvidia-container-toolkit.log&quot;
#ldcache = &quot;/etc/ld.so.cache&quot;
load-kmods = true
#no-cgroups = false
no-cgroups = true
#user = &quot;root:video&quot;
ldconfig = &quot;@/sbin/ldconfig.real&quot;

[nvidia-container-runtime]
#debug = &quot;/var/log/nvidia-container-runtime.log&quot;
debug = &quot;~/.local/nvidia-container-runtime.log&quot;
log-level = &quot;info&quot;

# Specify the runtimes to consider. This list is processed in order and the PATH
# searched for matching executables unless the entry is an absolute path.
runtimes = [
    &quot;docker-runc&quot;,
    &quot;runc&quot;,
]

mode = &quot;auto&quot;

[nvidia-container-runtime.modes.csv]
mount-spec-path = &quot;/etc/nvidia-container-runtime/host-files-for-container.d&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Configure hook with this lines:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Configure hook

sudo -i
mkdir -p /usr/share/containers/oci/hooks.d/
cat &amp;lt;&amp;lt; EOF | sudo tee /usr/share/containers/oci/hooks.d/oci-nvidia-hook.json
{
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;hook&quot;: {
        &quot;path&quot;: &quot;/usr/bin/nvidia-container-toolkit&quot;,
        &quot;args&quot;: [&quot;nvidia-container-toolkit&quot;, &quot;prestart&quot;],
        &quot;env&quot;: [
            &quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&quot;
        ]
    },
    &quot;when&quot;: {
        &quot;always&quot;: true,
        &quot;commands&quot;: [&quot;.*&quot;]
    },
    &quot;stages&quot;: [&quot;prestart&quot;]
}
EOF
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Last step for configuration is to increase limits defined in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/security/limits.conf&lt;/code&gt; like below, replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[your-user]&lt;/code&gt; by what returns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;whoami&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[your-user] soft memlock unlimited
[your-user] hard memlock unlimited
[your-user] soft stack 65536
[your-user] hard stack 65536
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you not yet familiar with that is NGC, it’s time to visite &lt;a href=&quot;https://catalog.ngc.nvidia.com/&quot;&gt;NGC Catalog&lt;/a&gt; and &lt;a href=&quot;https://catalog.ngc.nvidia.com/orgs/nvidia/collections/gettingstarted&quot;&gt;the getting started&lt;/a&gt;. Create your account and install &lt;a href=&quot;https://ngc.nvidia.com/setup&quot;&gt;ngc cli&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s try this &lt;a href=&quot;https://catalog.ngc.nvidia.com/orgs/nvidia/resources/fashion_mnist_tf_example/version/1.0/files/FashionMNIST%20Notebook.ipynb&quot;&gt;example&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Launch example with: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;podman run -it --gpus all -p 8888:8888 -v $PWD:/projects --network=host nvcr.io/nvidia/tensorflow:20.08-tf1-py3&lt;/code&gt; and follow jupyter notebook. You should able to run example:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/gfx/ngc-example.png&quot; alt=&quot;ngc-example&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;podman on wsl works great&lt;/li&gt;
  &lt;li&gt;with ngc container running localy, it’s easy to learn and test ML/AI topics&lt;/li&gt;
  &lt;li&gt;first step before to work with large scale environnement like Base Command&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="ia" /><summary type="html">I’m a big server Linux fan and have used laptop macOS for over 10 years now for its unix like shell. Windows has now the famous Windows Subsystem for Linux, time to give it a shot! Furthermore, I want also escape Docker Desktop fees… Let’s try something fancy.</summary></entry><entry><title type="html">Ubunru 20.04 LTS Jumpbox</title><link href="https://bdereims.github.io/linux/2022/07/19/jumpbox.html" rel="alternate" type="text/html" title="Ubunru 20.04 LTS Jumpbox" /><published>2022-07-19T08:00:00+00:00</published><updated>2022-07-19T08:00:00+00:00</updated><id>https://bdereims.github.io/linux/2022/07/19/jumpbox</id><content type="html" xml:base="https://bdereims.github.io/linux/2022/07/19/jumpbox.html">&lt;p&gt;It’s always good to have a VM Jumbox or a simple way to configure your machine! For this I wrote a bunch of automated scripts, for this annoying task. You will get the necessary setup and tools to perform your daily tasks. It comes with: kubectl, stern, docker engine, docker-compose, helm, govc, kubectx, kubens, extend-rootfs.sh, curl, jq, sshpass, unzip, tmux, bash-completion, startup-script.&lt;/p&gt;

&lt;p&gt;Use this &lt;a href=&quot;https://github.com/bdereims/cloud-garage/tree/main/install/sixty9&quot;&gt;repo&lt;/a&gt; and execute as root &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bootsrap.sh&lt;/code&gt;. Only validated for freshly installed Ubuntu 20.04 LTS, as VM or bare metal.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;</content><author><name></name></author><category term="linux" /><summary type="html">It’s always good to have a VM Jumbox or a simple way to configure your machine! For this I wrote a bunch of automated scripts, for this annoying task. You will get the necessary setup and tools to perform your daily tasks. It comes with: kubectl, stern, docker engine, docker-compose, helm, govc, kubectx, kubens, extend-rootfs.sh, curl, jq, sshpass, unzip, tmux, bash-completion, startup-script.</summary></entry><entry><title type="html">Nested SDDC for Testing/Lab/Demo</title><link href="https://bdereims.github.io/vmware/2022/06/24/cPodFactory.html" rel="alternate" type="text/html" title="Nested SDDC for Testing/Lab/Demo" /><published>2022-06-24T17:00:00+00:00</published><updated>2022-06-24T17:00:00+00:00</updated><id>https://bdereims.github.io/vmware/2022/06/24/cPodFactory</id><content type="html" xml:base="https://bdereims.github.io/vmware/2022/06/24/cPodFactory.html">&lt;p&gt;cPodFactory is one of my projects during my VMware years. The main purpose is to automatically and dynamically create nested SDDC environments. It’s means you have the capability to create a separated but nested vSphere SDDC fully routed (dedicated L2 but L3 routed) configured and ready to use.&lt;/p&gt;

&lt;p&gt;It comes with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cpodctl&lt;/code&gt; command line giving you all necessary command to manage cPod lifecycle. A cPod is a lab or if you prefer the nested vSphere. You can:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Create a cPod: naked one (without esx but all networking facilities) or specifying number of esx&lt;/li&gt;
  &lt;li&gt;Delete a cPod entirely, caution - it’s fast without roll back&lt;/li&gt;
  &lt;li&gt;Deploy &amp;amp; configure vCenter accordingly your cPod&lt;/li&gt;
  &lt;li&gt;List all cPods&lt;/li&gt;
  &lt;li&gt;Deploy VCF cloudbuilder if you want to transform cPod into VCF cluster(s)&lt;/li&gt;
  &lt;li&gt;Retrieve the auto generated cPod password&lt;/li&gt;
  &lt;li&gt;Override some variables to customize your cPod&lt;/li&gt;
  &lt;li&gt;Use completion in bash to facilitate life with tab key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;cpodctl cli:
&lt;img src=&quot;/gfx/cpodfactory-cpodctl.png&quot; alt=&quot;cpodctl cli&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A large Availability Zone running physical layer by VCF:
&lt;img src=&quot;/gfx/cpodfactory-az-fkd.png&quot; alt=&quot;cpodctl cli&quot; /&gt;&lt;/p&gt;

&lt;p&gt;cPodFactory also offers:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Multi availability zones and connect them via wireguard: it’s possible to move workload across different az or to connect services on different cPods&lt;/li&gt;
  &lt;li&gt;DNS resolution for all az&lt;/li&gt;
  &lt;li&gt;VPN for client with OpenVPN, Windows/Mac/Linux compatible&lt;/li&gt;
  &lt;li&gt;DHCP for each L2 connectivity&lt;/li&gt;
  &lt;li&gt;Dynamic L3 routing with BGP, with the possibility to peer NSX Edge in a cPod&lt;/li&gt;
  &lt;li&gt;Nested NSX and nested VSAN&lt;/li&gt;
  &lt;li&gt;It comes with cPodEdge and cPodRouter VM template for connectivity and network services (based on PhotonOS Linux)&lt;/li&gt;
  &lt;li&gt;Utilities to automaticaly deploy OVA and Windows/Linux jumpHost in cPod&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It needs for the physical layer:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;at least 2 or 3 esx 6.7 + vCenter or &lt;a href=&quot;https://www.vmware.com/products/cloud-foundation.html&quot;&gt;VCF&lt;/a&gt; with 4 esx&lt;/li&gt;
  &lt;li&gt;vSAN for storage or any shared datastore (NFS, iSCSI, FC)&lt;/li&gt;
  &lt;li&gt;VLAN backend network or NSX overlay (NSX is not mandatory at all)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I ran it for 4 years to help colleagues to have serious labs and also used it for all my customer workshops. We have never had severe issue of availability or performance - thanks to vSphere for its capabilities to run heavy workloads. It has been deployed in several country interconnected via wireguard: Paris(FR), OVH(FR), Madrid(SP), Munich(DE), Dubai(UAE).&lt;/p&gt;

&lt;p&gt;To give you some ideas of use cases:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Large Proof Of Concept with Tanzu running Telco NVFs and consuming +480Gb memory in kubernetes, 9 esx cPod&lt;/li&gt;
  &lt;li&gt;Demo cPod dedicated to &lt;a href=&quot;https://www.vmware.com/products/vrealize-automation.html&quot;&gt;vRealize Automation&lt;/a&gt; with NSX and vSAN connected with Public Cloud deploying hybrid App&lt;/li&gt;
  &lt;li&gt;multi &lt;a href=&quot;https://www.vmware.com/products/cloud-foundation.html&quot;&gt;VCF&lt;/a&gt; cPods in different regions (Paris &amp;lt;-&amp;gt; Dubai) moving VM workloads via &lt;a href=&quot;https://www.vmware.com/products/hcx.html&quot;&gt;HCX&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Cloud Migration from cPod in &lt;a href=&quot;https://www.ovhcloud.com&quot;&gt;OVH&lt;/a&gt; to &lt;a href=&quot;https://vmc.vmware.com/home&quot;&gt;VMC&lt;/a&gt; in AWS, moving VM via &lt;a href=&quot;https://www.vmware.com/products/hcx.html&quot;&gt;HCX&lt;/a&gt;, fully routed without application interruption, keeping on-prem DB&lt;/li&gt;
  &lt;li&gt;All new vSphere 8 cPod with &lt;a href=&quot;https://tanzu.vmware.com/&quot;&gt;Tanzu&lt;/a&gt; Grid 2.0 for training purpose&lt;/li&gt;
  &lt;li&gt;nVIDIA AI Enterprise naked cPod bringing agile AI for enterprise running on vSphere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This project is open source. You can use it, improve it but not in production. Nested is not supported/allowed for production.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/bdereims/cPodFactory&quot;&gt;Check out git repo&lt;/a&gt; - you find here all the necessary to install yours.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;</content><author><name></name></author><category term="vmware" /><summary type="html">cPodFactory is one of my projects during my VMware years. The main purpose is to automatically and dynamically create nested SDDC environments. It’s means you have the capability to create a separated but nested vSphere SDDC fully routed (dedicated L2 but L3 routed) configured and ready to use.</summary></entry><entry><title type="html">Tanzu Konw It All</title><link href="https://bdereims.github.io/kubernetes/2022/06/24/tkia.html" rel="alternate" type="text/html" title="Tanzu Konw It All" /><published>2022-06-24T16:59:00+00:00</published><updated>2022-06-24T16:59:00+00:00</updated><id>https://bdereims.github.io/kubernetes/2022/06/24/tkia</id><content type="html" xml:base="https://bdereims.github.io/kubernetes/2022/06/24/tkia.html">&lt;p&gt;If you want to quickly discover Tanzu or practice a lot kubernetes in order to prepare CKA or CKAD certification, I have thing for you…&lt;/p&gt;

&lt;p&gt;Check out my &lt;a href=&quot;https://github.com/bdereims/tkia&quot;&gt;TKIA&lt;/a&gt; git repo, you get here links,docs and usefull scripts that I made during so many customer workshops.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;</content><author><name></name></author><category term="kubernetes" /><summary type="html">If you want to quickly discover Tanzu or practice a lot kubernetes in order to prepare CKA or CKAD certification, I have thing for you…</summary></entry></feed>