Skip to content

Commit

Permalink
DT-125 Rancher Desktop added as a step and Kubernetes disabled (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSotoEstrada authored Mar 22, 2023
1 parent 38e5302 commit 634aedf
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Casks/ih-rancher.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cask "ih-rancher" do
version "1.7.0"
version "1.8.1"

if Hardware::CPU.intel?
url "https://github.com/rancher-sandbox/rancher-desktop/releases/download/v#{version}/Rancher.Desktop-#{version}.x86_64.dmg"
sha256 "828dde44868c3c33fe709e099f9af080143a379f9fba2e3bacd8641f5ad8e72b"
sha256 "5233a6b7024077bb2102f8c4afde7bed79207ab4d1989d8b2e34e5b353ef3d82"
else
url "https://github.com/rancher-sandbox/rancher-desktop/releases/download/v#{version}/Rancher.Desktop-#{version}.aarch64.dmg"
sha256 "41feea152b3dcff8fb729106b195e4dc7632cda669ef7054045f72c595825242"
sha256 "ed88c10760cf5ff03bfcfa68870a90bb839d79dd95a8357def11875fb1ffbd23"
end

name "Rancher Desktop"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.16
0.1.17
21 changes: 4 additions & 17 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,14 @@ for _ in 1 2 3; do
done

if [ $SUCCEEDED -eq 1 ]; then
echo "Install of ih-setup formula failed. Please contact platform support
in the #developer-platform-support channel in Slack (https://ih-epdd.slack.com/archives/C03GXCDA48Y).
echo "Install of ih-setup formula failed. Please contact support
in the #developer-tools channel in Slack (https://ih-epdd.slack.com/archives/C04LPMF4YPL).
You can also search Confluence for 'Engineer Onboarding Guide' for
more troubleshooting tips."
exit 1
fi

CASKSUCCEEDED=1
for _ in 1 2 3; do
brew install ih-rancher
CASKSUCCEEDED=$?
if [ $CASKSUCCEEDED -eq 0 ]; then
break
fi
done

if [ $CASKSUCCEEDED -eq 1 ]; then
echo "Install Casks packages failed. Please contact platform support
in the #developer-platform-support channel in Slack (https://ih-epdd.slack.com/archives/C03GXCDA48Y)."
exit 1
fi

if command -v ih-setup; then
ih-setup install
Expand All @@ -58,8 +45,8 @@ if command -v ih-setup; then
echo "Install succeeded. You should be able to start a new shell
and have everything work correctly."
else
echo "Install failed. Please contact platform support
in the #developer-platform-support channel in Slack (https://ih-epdd.slack.com/archives/C03GXCDA48Y).
echo "Install failed. Please contact support
in the #developer-tools channel in Slack (https://ih-epdd.slack.com/archives/C04LPMF4YPL).
You can also search Confluence for 'Engineer Onboarding Guide' for
more troubleshooting tips.
Expand Down
2 changes: 1 addition & 1 deletion formula/ih-core.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class IhCore < Formula
VERSION="0.1.16"
VERSION="0.1.17"
desc "Brew formula for installing core tools used at Included Health engineering."
homepage "https://github.com/ConsultingMD/homebrew-ih-public"
license "CC BY-NC-ND 4.0"
Expand Down
134 changes: 134 additions & 0 deletions lib/core/rancher/io.rancherdesktop.profile.defaults.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>WSL</key>
<dict>
<key>integrations</key>
<dict/>
</dict>
<key>application</key>
<dict>
<key>adminAccess</key>
<true/>
<key>autoStart</key>
<true/>
<key>debug</key>
<false/>
<key>hideNotificationIcon</key>
<false/>
<key>pathManagementStrategy</key>
<string>manual</string>
<key>startInBackground</key>
<true/>
<key>telemetry</key>
<dict>
<key>enabled</key>
<true/>
</dict>
<key>updater</key>
<dict>
<key>enabled</key>
<true/>
</dict>
<key>window</key>
<dict>
<key>quitOnClose</key>
<false/>
</dict>
</dict>
<key>containerEngine</key>
<dict>
<key>allowedImages</key>
<dict>
<key>enabled</key>
<false/>
<key>patterns</key>
<array/>
</dict>
<key>name</key>
<string>moby</string>
</dict>
<key>diagnostics</key>
<dict>
<key>mutedChecks</key>
<dict/>
<key>showMuted</key>
<false/>
</dict>
<key>experimental</key>
<dict>
<key>virtualMachine</key>
<dict>
<key>mount</key>
<dict>
<key>9p</key>
<dict>
<key>cacheMode</key>
<string>mmap</string>
<key>msizeInKB</key>
<integer>128</integer>
<key>protocolVersion</key>
<string>9p2000.L</string>
<key>securityModel</key>
<string>none</string>
</dict>
<key>type</key>
<string>reverse-sshfs</string>
</dict>
<key>networkingTunnel</key>
<false/>
<key>socketVMNet</key>
<false/>
<key>type</key>
<string>qemu</string>
<key>useRosetta</key>
<false/>
</dict>
</dict>
<key>images</key>
<dict>
<key>namespace</key>
<string>k8s.io</string>
<key>showAll</key>
<true/>
</dict>
<key>kubernetes</key>
<dict>
<key>enabled</key>
<false/>
<key>ingress</key>
<dict>
<key>localhostOnly</key>
<false/>
</dict>
<key>options</key>
<dict>
<key>flannel</key>
<true/>
<key>traefik</key>
<true/>
</dict>
<key>port</key>
<integer>6443</integer>
<key>version</key>
<string>1.25.7</string>
</dict>
<key>portForwarding</key>
<dict>
<key>includeKubernetesServices</key>
<false/>
</dict>
<key>version</key>
<integer>6</integer>
<key>virtualMachine</key>
<dict>
<key>hostResolver</key>
<true/>
<key>memoryInGB</key>
<integer>6</integer>
<key>numberCPUs</key>
<integer>2</integer>
</dict>
</dict>
</plist>
72 changes: 72 additions & 0 deletions lib/core/rancher/step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# IH_CORE_DIR will be set to the directory containing the bin and lib directories.

function ih::setup::core.rancher::help() {
echo 'Install Rancher Desktop as an alternative to Docker Desktop'
}

# Check if the step has been installed and return 0 if it has.
# Otherwise return 1.
function ih::setup::core.rancher::test() {


# Check for PLIST FILE
PLISTFILE="$HOME/Library/Preferences/io.rancherdesktop.profile.defaults.plist"
if [ -f "$PLISTFILE" ]; then
return 0
fi


ih::log::debug "Rancher Desktop is not available"
return 1
}

function ih::setup::core.rancher::deps() {
echo "core.shell"
}


function ih::setup::core.rancher::install() {
local THIS_DIR="$IH_CORE_LIB_DIR/core/rancher"

cp "${THIS_DIR}/io.rancherdesktop.profile.defaults.plist" "$HOME/Library/Preferences/io.rancherdesktop.profile.defaults.plist"



CASKSUCCEEDED=1
# Installation and configuration of Rancher Desktop
for _ in 1 2 3; do

# Detect Rosetta
if [[ $(sysctl -n sysctl.proc_translated) -eq 1 ]]; then
# Rosetta Active
arch -arm64 -c brew reinstall ih-rancher
else
brew reinstall ih-rancher
fi

CASKSUCCEEDED=$?
if [ $CASKSUCCEEDED -eq 0 ]; then
break
fi
done

rm -rf ~/.rd
$(/Applications/Rancher\ Desktop.app/Contents/Resources/resources/darwin/bin/rdctl start)
# Check for docker binary in /usr/local/bin
# Check if /usr/local/bin/docker exists
DOCKERBIN=/usr/local/bin/docker
DOCKERCOMPOSEBIN=/usr/local/bin/docker-compose
if [ ! -f "$DOCKERBIN" ]; then

echo "In order to continue with Rancher configuration and be able to use this engine, some IDEs require the creation of symlinks for remote Python interpreters"
echo "Your password is required for the creation of symlink mentioned above"
sudo ln -s $HOME/.rd/bin/docker /usr/local/bin/docker
if [ ! -f "$DOCKERCOMPOSEBIN" ]; then
sudo ln -s $HOME/.rd/bin/docker-compose /usr/local/bin/docker-compose
fi
fi

echo "Rancher Desktop has been installed successfully"
}

0 comments on commit 634aedf

Please sign in to comment.