diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d6e3270 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: Build setup guides +on: + push: +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Build + run: | + git config user.name github-actions + git config user.email github-actions@github.com + bundle exec ruby build.rb + if ! git diff --exit-code + then + git add . + git commit -m "setup guides generated" + git push + fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4541a7b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.bundle/ +vendor/ diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..6393cf2 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,6 @@ + + Layout/HashAlignment: + Enabled: false + + Layout/LeadingEmptyLines: + Enabled: false diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..7636e75 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +4.0.5 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..632fced --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "liquid" +gem "base64" +gem "cgi" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..29d32bb --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,29 @@ +GEM + remote: https://rubygems.org/ + specs: + base64 (0.3.0) + bigdecimal (4.1.2) + cgi (0.5.1) + liquid (5.12.0) + bigdecimal + strscan (>= 3.1.1) + strscan (3.1.8) + +PLATFORMS + arm64-darwin-24 + ruby + +DEPENDENCIES + base64 + cgi + liquid + +CHECKSUMS + base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + cgi (0.5.1) sha256=e93fcafc69b8a934fe1e6146121fa35430efa8b4a4047c4893764067036f18e9 + liquid (5.12.0) sha256=5a3c2c2430cd925d21c53e4ed9abea52cd0a9da53b541422f81dee79aca2a673 + strscan (3.1.8) sha256=aae2db611a225559f21ffbb71765c9a4e60fd262534a9ea84f4f11c7f32f679e + +BUNDLED WITH + 4.0.10 diff --git a/LINUX.md b/LINUX.md index 0c18893..2853086 100644 --- a/LINUX.md +++ b/LINUX.md @@ -6,6 +6,7 @@ Please **read them carefully and execute all commands in the following order**. Let's start :rocket: + ## GitHub account Have you signed up to GitHub? If not, [do it right away](https://github.com/join). @@ -16,6 +17,7 @@ Have you signed up to GitHub? If not, [do it right away](https://github.com/join :point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub. + ## Visual Studio Code ### Installation @@ -64,6 +66,8 @@ code :x: Otherwise, please **contact a teacher** + + ## VS Code Extensions ### Installation @@ -82,6 +86,7 @@ code --install-extension alexcvzz.vscode-sqlite ``` Here is a list of the extensions you are installing: + - [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings) - [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons) - [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare) @@ -91,8 +96,39 @@ Here is a list of the extensions you are installing: - [Jupyter](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) - [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite) + ## Command line tools +### Check the locale + +The locale is a mechanism allowing to customize programs to your language and country. + +Let's verify that the default locale is set to English, please type this in the Ubuntu terminal: + +```bash +locale +``` + +If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale: + +```bash +sudo locale-gen en_US.UTF-8 +``` + +If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following: + +
+ Generate locale + +Please, run this lines in your terminal. + +```bash +sudo update-locale LANG=en_US.UTF8 +sudo apt-get update +sudo apt-get install language-pack-en language-pack-en-base manpages +``` +
+ ### Zsh & Git Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), we will use `zsh`. @@ -100,7 +136,6 @@ Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_ We will also use [`git`](https://git-scm.com/), a command line software used for version control. Let's install them, along with other useful tools: - - Open an **Ubuntu terminal** - Copy and paste the following commands: @@ -149,6 +184,7 @@ gh --version :x: Otherwise, please **contact a teacher** + ## Oh-my-zsh Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/). @@ -169,15 +205,19 @@ At the end your terminal should look like this: :x: Otherwise, please **ask for a teacher** + ## direnv [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -190,7 +230,7 @@ We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol t First in order to **login**, copy-paste the following command in your terminal: -:warning: **DO NOT edit the `email`** +:warning: **DO NOT edit the `email`** — Even though `user:email` looks like a placeholder for your actual email address, it isn't — do not replace it. ```bash gh auth login -s 'user:email' -w --git-protocol ssh @@ -202,7 +242,9 @@ gh auth login -s 'user:email' -w --git-protocol ssh If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`. -- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`. +- `Enter a passphrase for your new SSH key (Optional)`: + - **FOR MOST PEOPLE:** Just press `Enter` to skip. You don't need a passphrase for the bootcamp and it would prompt you every time you use the key. There is a risk, however, that if someone steals your laptop, they could then push to GitHub. + - **IF SECURITY IS REALLY IMPORTANT TO YOU:** Enter a passphrase of your choice and press `Enter`. It's _really_ important that if you enter a passphrase, you write it down somewhere immediately and do not lose/forget it. You will need to enter this frequently. - `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`. @@ -229,6 +271,7 @@ gh auth status :x: If not, **contact a teacher**. + ## Google Cloud CLI Install the `gcloud` CLI to communicate with [Google Cloud Platform](https://cloud.google.com/) through your terminal: @@ -243,6 +286,7 @@ sudo apt-get install google-cloud-sdk-app-engine-python 👉 [Install documentation](https://cloud.google.com/sdk/docs/install#deb) + ## Dotfiles Hackers love to refine and polish their shell and tools. We'll start with a great default configuration provided by [Le Wagon](http://github.com/lewagon/dotfiles), stored on GitHub. @@ -263,6 +307,7 @@ There seems to be a problem with the previous step (`gh auth`). There are three options, choose **one**: +
I did not attend the Web Dev or Data Science & AI or Data Analytics bootcamp at Le Wagon @@ -282,6 +327,7 @@ gh repo fork lewagon/dotfiles --clone
+
I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI or Data Analytics) but I have a new laptop @@ -296,6 +342,7 @@ mkdir -p ~/code/$GITHUB_USERNAME && cd $_ gh repo clone $GITHUB_USERNAME/dotfiles ``` + Open your terminal and go to your `dotfiles` project: ```bash @@ -303,7 +350,9 @@ cd ~/code/$GITHUB_USERNAME/dotfiles ``` Time to merge the changes from `lewagon/dotfiles` into yours: + 1. Commit your current version of your dotfiles: + ```bash git add . git status # Check what will be committed @@ -362,7 +411,9 @@ cd ~/code/$GITHUB_USERNAME/dotfiles ``` Time to merge the changes from `lewagon/dotfiles` into yours: + 1. Commit your current version of your dotfiles: + ```bash git add . git status # Check what will be committed @@ -460,8 +511,11 @@ Check if you have `conda` installed on your machine: ```bash conda list ``` + + If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. +
conda uninstall instructions @@ -478,12 +532,15 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line + - Save the file with `CTRL` + `s` + - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` @@ -491,6 +548,7 @@ rm -rf ~/.anaconda_backup
+ ### Install `pyenv` Ubuntu comes with an outdated version of Python that we don't want to use. You might already have installed Anaconda or something else to tinker with Python and Data Analytics packages. All of this does not really matter as we are going to do a professional setup of Python where you'll be able to switch which version you want to use whenever you type `python` in the terminal. @@ -550,6 +608,7 @@ exec zsh To check if this worked, run `python --version`. If you see `3.12.9`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). + ## Python Virtual Environment Before we start installing relevant Python packages, we will isolate the setup for the Bootcamp into a **dedicated** virtual environment. We will use a `pyenv` plugin called [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). @@ -577,6 +636,7 @@ pyenv global lewagon Great! Anytime we'll install Python package, we'll do it in that environment. + ### Python packages Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. @@ -589,10 +649,15 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` + + + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -606,6 +671,7 @@ mkdir -p $LOCATION curl $SOURCE > $LOCATION/custom.css ``` + ## Python setup check ### Python and packages check @@ -666,6 +732,7 @@ You can close your web browser then terminate the jupyter server with `CTRL` + ` Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. + ## Insomnia > ℹ️ **Why?** Insomnia is one of the best-known API testing tools, and it will be useful in our Introduction to API course. @@ -676,6 +743,7 @@ Here you have it! A complete python virtual env with all the third-party package - Install Insomnia + ## Google Cloud Platform setup [GCP](https://cloud.google.com/) is a cloud solution that you are going to use in order to deploy your Machine Learning-based products to production. @@ -805,10 +873,12 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP + ```bash gcloud auth login ``` + - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present @@ -903,6 +973,7 @@ An alternate way to navigate to the Service Accounts page is from the following: - The browser has now saved the service account json file 🔑 in your downloads directory (it is named according to your service account name, something like `le-wagon-data-123456789abc.json`). + - Store the service account json file somewhere you'll remember, for example: ``` bash @@ -925,6 +996,8 @@ code ~/.zshrc in the Terminal! 😄 + +
ℹ️ How to find the absolute path of a file? You can drag and drop the file in your terminal. @@ -976,13 +1049,13 @@ gcloud projects get-iam-policy PROJECT_ID \ Troubleshooting - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` - - Make sure that billing is enabled for your Google Cloud Platform project https://cloud.google.com/billing/docs/how-to/modify-project - + - Make sure that billing is enabled for your Google Cloud Platform project [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project)
🏁 You are done with the GCP setup! -## Kitt + + ## Kitt You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). @@ -990,6 +1063,7 @@ Then you should receive an additional invitation from Slack, inviting you to the If you haven't, please contact your teaching team. + ## Slack [Slack](https://slack.com/) is a communication platform pretty popular in the tech industry. @@ -1000,6 +1074,7 @@ If you haven't, please contact your teaching team. :warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured. + ### Settings Launch the app and sign in to `lewagon-alumni` organization. @@ -1011,7 +1086,6 @@ Make sure you **upload a profile picture** :point_down: The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc. To ensure that everything is working fine for video calls, let's test your camera and microphone: - - Open the Slack app - Click your profile picture in the top right. - Select `Preferences` from the menu. @@ -1027,14 +1101,11 @@ To ensure that everything is working fine for video calls, let's test your camer You can also install Slack app on your phone and sign in `lewagon-alumni`! -## Setup completed! -That's all you need for now! Some of the free trial periods on the tools we use are very short, so from now on, whenever we introduce a new tool or software, we will guide you through the sign-in and installation steps at the beginning of the day. - -Ready to start? 🚀 - -## (Bonus) +## Bonus If you are done with your setup, please ask around if some classmates need some help with theirs (macOS, Linux, Windows). We will have our first lectures at 2pm and will talk about the Setup you just did + onboard you on Kitt. If you don't have a lot of experience with `git` and GitHub, please [(re-)watch this workshop](https://www.youtube.com/watch?v=Z9fIBT2NBGY) (`1.25` playback speed is fine). + + diff --git a/LINUX_keep_current.md b/LINUX_keep_current.md index ef9d520..9f15539 100644 --- a/LINUX_keep_current.md +++ b/LINUX_keep_current.md @@ -87,10 +87,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : + ``` bash cd $(pyenv root) && git pull ``` + Install the current python version : ```bash @@ -141,10 +143,14 @@ pyenv versions pip install -U pip ``` + + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` + + ## GCP Make sure that the `gcloud` command is linked to the email address of your Google Cloud Platform account : @@ -231,6 +237,7 @@ Make sure that the file contains the correct : 👉 If this does not display anything or if the email inside of the file is not the one of your service account, go back to the setup + ## Python setup check ### Python and packages check @@ -290,3 +297,5 @@ It should output `3.12.9` followed by some more details. If not, check with a TA You can close your web browser then terminate the jupyter server with `CTRL` + `C`. Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. + + diff --git a/README.es.md b/README.es.md deleted file mode 100644 index 99d9de7..0000000 --- a/README.es.md +++ /dev/null @@ -1,47 +0,0 @@ -## Configuración del Bootcamp de Data Analytics - -Por favor escoge tu sistema operativo: - - - - - - - -
- - macOS - - - - Windows - - - - Linux - -
- -## Mantén tu configuración al día después del bootcamp - -Por favor escoge tu sistema operativo: - - - - - - - -
- - macOS - - - - Windows - - - - Linux - -
diff --git a/VM.md b/VM.md index a00d914..01ac333 100644 --- a/VM.md +++ b/VM.md @@ -6,6 +6,7 @@ Please **read them carefully and execute all commands in the following order**. Let's start :rocket: + ## GitHub account Have you signed up to GitHub? If not, [do it right away](https://github.com/join). @@ -16,6 +17,7 @@ Have you signed up to GitHub? If not, [do it right away](https://github.com/join :point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub. + ## SSH key We want to safely communicate with your virtual machine using [SSH protocol](https://en.wikipedia.org/wiki/Secure_Shell). We need to generate a SSH key to authenticate. @@ -34,24 +36,22 @@ We highly recommend installing [Windows Terminal](https://apps.microsoft.com/sto Windows ```bash -# replace "your_email@example.com" with your GCP account email -ssh-keygen.exe -t ed25519 -C "your_email@example.com" +# replace your_email@example.com, this is purely informative and allows you to remember the use of this key +ssh-keygen.exe -t ed25519 -C your_email@example.com ``` -
MacOS & Linux ```bash -# replace "your_email@example.com" with your GCP account email -ssh-keygen -t ed25519 -C "your_email@example.com" +# replace your_email@example.com, this is purely informative and allows you to remember the use of this key +ssh-keygen -t ed25519 -C your_email@example.com ``` -
-You should get the following message: `> Generating public/private algorithm key pair.` +You should get the following message: `> Generating public/private algorithm key pair.` - When you are prompted `> Enter a file in which to save the key`, press Enter - You should be asked to `Enter a passphrase` - this is optional if you want additional security. To continue without a passphrase press enter without typing anything when asked to enter a passphrase. @@ -68,13 +68,14 @@ If you receive this message, you may already have an SSH Key with the same name To create a separate SSH key to exclusively use for this bootcamp use the following: ```bash -# replace "your_email@example.com" with your GCP account email -ssh-keygen -t ed25519 -f ~/.ssh/de-bootcamp -C "your_email@example.com" +# replace your_email@example.com, this is purely informative and allows you to remember the use of this key +ssh-keygen -t ed25519 -f ~/.ssh/da-bootcamp -C your_email@example.com ``` -Your new SSH Key will be named `de-bootcamp`. Make sure to remember it for later! +Your new SSH Key will be named `da-bootcamp`. Make sure to remember it for later! + ## Google Cloud Platform setup [GCP](https://cloud.google.com/) is a cloud solution that you are going to use in order to work on a virtual machine. @@ -97,15 +98,13 @@ Your new SSH Key will be named `de-bootcamp`. Make sure to remember it for later In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: -[https://myaccount.google.com/language](https://myaccount.google.com/language) +https://myaccount.google.com/language If the *preferred language* is not: - - **English** - **United States** Then switch the language to english: - - Click on the edit pen logo - Select **English** - Select **United States** @@ -144,13 +143,14 @@ Once this is done, verify that your billing account is linked to your GCP projec You should now see: -```bash +``` Free trial status: $300 credit and 91 days remaining - with a full account, you'll get unlimited access to all of Google Cloud Platform. ```
👉 If you do not own a credit card 👈 + If you do not own a credit card, an alternative is to setup a **Revolut** account. Revolut is a financial app that will allow you to create a virtual credit card linked to your mobile phone billing account. @@ -170,7 +170,6 @@ Once this is done, select the standard (free) plan. No need to add the card to A You now have a virtual card which we will use for the GCP setup. In the main view of the Revolut the app - - Click on Ready to use - Click on the card - Click on Show card details @@ -181,6 +180,7 @@ In the main view of the Revolut the app
👉 If you receive an email from Google saying "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 + This may happen especially in case you just setup a Revolut account. - Click on PROCEED TO VERIFICATION @@ -215,88 +215,22 @@ Go to your project [APIs dashboard](https://console.cloud.google.com/apis/dashbo APIs enable - Compute Engine is now enabled on your project -## Virtual Machine (VM) - -**👌 Note: Skip to the next section if you already have a VM set up** - -_Note: The following section requires you already have a [Google Cloud Platform](https://cloud.google.com/) account associated with an active [Billing account](https://console.cloud.google.com/billing)._ - -- Go to console.cloud.google.com > > Compute Engine > VM instances > Create instance -- Name it `lewagon-data-eng-vm-`, replace `` with your own, e.g. `krokrob` -- Region `europe-west1`, choose the closest one among the [available regions](https://cloud.google.com/compute/docs/regions-zones#available) - - gcloud-console-vm-create-instance -- In the section `Machine configuration` under the sub-heading `Machine type` -- Select General purpose > PRESET > e2-standard-4 - - gcloud-console-vm-e2-standard4 -- Boot disk > Change - - Operating system > Ubuntu - - Version > Ubuntu 22.04 LTS x86/64 - - Boot disk type > Balanced persistent disk - - Size > upgrade to 150GB - - gcloud-console-vm-ubunt -- Open `Networking, Disks, ...` under `Advanced options` -- Open `Networking` - - gcloud-console-vm-networking -- Go to `Network interfaces` and click on `default default (...)` with a downward arrow on the right. - - gcloud-console-vm-network-interfaces -- This opened a box `Edit network interface` -- Go to the dropdown `External IPv4 address`, click on it, click on `RESERVE STATIC EXTERNAL IP ADDRESS` - - gcloud-console-vm-create-static-ip -- Give it a name, like "lewagon-data-eng-vm-ip-" (replace `` with your own) and description "Le Wagon - Data Engineering VM IP". This will take a few seconds. - - gcloud-console-reserve-static-ip - -- You will now have a public IP associated with your account, and later to your VM instance. Click on `Done` at the bottom of the section `Edit network interface` you were in. - - gcloud-console-new-external-ip - -### Public SSH key - -- Open the `Security` section - gcloud-console-vm-security -- Open the `Manage access` subsection - gcloud-console-manage-access -- Go to `Add manually generated SSH keys` and click `Add item` - - gcloud-console-add-manual-ssh-key -- In your terminal display your public SSH key: - - Windows: navigate to where you created your SSH key and open `id_ed25519.pub` - - - Mac/Linux users can use: - - ```bash - cat ~/.ssh/id_ed25519.pub - # OR cat ~/.ssh/de-bootcamp.pub if you created a unique key - ``` - -- Copy your public SSH key and paste it: - - gcloud-console-add-ssh-key-pub -- On the right hand side you should see +## Virtual Machine (VM) - gcloud-console-vm-price-month -- You should be good to go and click `CREATE` at the bottom +_Note: The VM setup requires a [Google Cloud Platform](https://cloud.google.com/) account associated with an active [Billing account](https://console.cloud.google.com/billing)_ - gcloud-console-vm-create -- It will take a few minutes for your virtual machine (VM) to be created. Your instance will show up like below when ready, with a green circled tick, named `lewagon-data-eng-vm-krokrob` (`krokrob` being replaced by your GitHub username). +ℹ️ In the guide, left click to drag the screenshots if necessary - gcloud-console-vm-instance-running -- Click on your instance +ℹ️ You may adjust the aspect ratio of your browser window to see the full screenshots - gcloud-console-vm-running -- Go down to the section `SSH keys`, and write down your username (you need it for the next section) + + scribe gcp vm + - gcloud-console-vm-username +**👌 Follow [this guide](https://scribehow.com/embed/Create_a_Google_Cloud_VM_Instance_with_SSH_Key__1ohFlAbSR9yoG28S0PDfwg) or skip to the next section if you already have a VM set up** -Congrats, your virtual machine is up and running, it is time to connect it with VS Code! ## Visual Studio Code @@ -309,10 +243,11 @@ Let's install [Visual Studio Code](https://code.visualstudio.com) text editor. - Open the file you have just downloaded. - Install it with few options: -![VS Code installation options](https://github.com/lewagon/data-engineering-setup/blob/main/https://github.com/lewagon/setup/blob/master/images/windows_vscode_installation.png) +![VS Code installation options](https://github.com/lewagon/setup/blob/master/images/windows_vscode_installation.png) When the installation is finished, launch VS Code. + ### VS Code Remote SSH Extension We need to connect VS Code to a virtual machine in the cloud so you will only work on that machine during the bootcamp. A pretty useful [**Remote SSH Extension**](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) is available on the VS Code Marketplace. @@ -338,6 +273,7 @@ That's the only extension you should install on your _local_ machine, we will in vscode-ssh-connection-command + - When prompted to `Select SSH configuration file to update`, pick the one in your home directory, under the `.ssh` folder, `~/.ssh/config` basically. Usually VS Code will pick automatically the best option, so their default should work. vscode-add-host-ssh-config @@ -374,14 +310,13 @@ Host IdentityFile User ``` - You can now change Host to whatever you would like to see as the name of your connection or in terminal with `ssh `! ❗️ It is important that the `Host` alias does not contain any whitespaces ❗️ ```bash # For instance -Host "de-bootcamp-vm" +Host "da-bootcamp-vm" HostName 34.77.50.76 # replace with your VM's public IP address IdentityFile User @@ -389,6 +324,8 @@ Host "de-bootcamp-vm" **The setup of your local machine is over. All following commands will be run from within your 🚨 virtual machine**🚨 terminal (via VS code for instance) + + ## VS Code Extensions ### Installation @@ -417,8 +354,39 @@ Here is a list of the extensions you are installing: - [Jupyter](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) - [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite) + ## Command line tools +### Check the locale + +The locale is a mechanism allowing to customize programs to your language and country. + +Let's verify that the default locale is set to English, please type this in the Ubuntu terminal: + +```bash +locale +``` + +If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale: + +```bash +sudo locale-gen en_US.UTF-8 +``` + +If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following: + +
+ Generate locale + +Please, run this lines in your terminal. + +```bash +sudo update-locale LANG=en_US.UTF8 +sudo apt-get update +sudo apt-get install language-pack-en language-pack-en-base manpages +``` +
+ ### Zsh & Git Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), we will use `zsh`. @@ -426,7 +394,6 @@ Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_ We will also use [`git`](https://git-scm.com/), a command line software used for version control. Let's install them, along with other useful tools: - - Open an **Ubuntu terminal** - Copy and paste the following commands: @@ -475,6 +442,7 @@ gh --version :x: Otherwise, please **contact a teacher** + ## Oh-my-zsh Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/). @@ -495,15 +463,19 @@ At the end your terminal should look like this: :x: Otherwise, please **ask for a teacher** + ## direnv [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -516,7 +488,7 @@ We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol t First in order to **login**, copy-paste the following command in your terminal: -:warning: **DO NOT edit the `email`** +:warning: **DO NOT edit the `email`** — Even though `user:email` looks like a placeholder for your actual email address, it isn't — do not replace it. ```bash gh auth login -s 'user:email' -w --git-protocol ssh @@ -528,7 +500,9 @@ gh auth login -s 'user:email' -w --git-protocol ssh If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`. -- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`. +- `Enter a passphrase for your new SSH key (Optional)`: + - **FOR MOST PEOPLE:** Just press `Enter` to skip. You don't need a passphrase for the bootcamp and it would prompt you every time you use the key. There is a risk, however, that if someone steals your laptop, they could then push to GitHub. + - **IF SECURITY IS REALLY IMPORTANT TO YOU:** Enter a passphrase of your choice and press `Enter`. It's _really_ important that if you enter a passphrase, you write it down somewhere immediately and do not lose/forget it. You will need to enter this frequently. - `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`. @@ -555,10 +529,10 @@ gh auth status :x: If not, **contact a teacher**. + ## Google Cloud CLI Install the `gcloud` CLI to communicate with [Google Cloud Platform](https://cloud.google.com/) through your terminal: - ```bash echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list sudo apt-get install apt-transport-https ca-certificates gnupg @@ -566,7 +540,6 @@ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyr sudo apt-get update && sudo apt-get install google-cloud-sdk sudo apt-get install google-cloud-sdk-app-engine-python ``` - 👉 [Install documentation](https://cloud.google.com/sdk/docs/install#deb) ### Create a service account key 🔑 @@ -578,11 +551,12 @@ Now that you have created a `GCP account` and a `project` (identified by its `PR
🤔 Why do we need a service account key ? + You have created a `GCP account` linked to your credit card. Your account will be billed according to your usage of the ressources of the **Google Cloud Platform**. The billing will occur if you consume anything once the free trial is over, or if you exceed the amount of spending allowed during the free trial. - In your `GCP account`, you have created a single `GCP project`, identified by its `PROJECT_ID`. The `GCP projects` allow you to organize and monitor more precisely how you consume the **GCP** resources. For the purpose of the bootcamp, we are only going to create a single project. + In your `GCP account`, you have created a single `GCP project`, identified by its `PROJECT_ID`. The `GCP projects` allow you to organize and monitor more precisely how you consume the **GCP** ressources. For the purpose of the bootcamp, we are only going to create a single project. - Now, we need a way to tell which resources within a `GCP project` our code will be allowed to consume. Our code consumes GCP resources through API calls. + Now, we need a way to tell which ressources within a `GCP project` our code will be allowed to consume. Our code consumes GCP ressources through API calls. Since API calls are not free, it is important to define with caution how our code will be allowed to use them. During the bootcamp this will not be an issue and we are going to allow our code to use all the API of **GCP** without any restrictions. @@ -616,11 +590,11 @@ Since the [service account](https://cloud.google.com/iam/docs/service-accounts) The browser has now saved the service account json file 🔑 in your downloads directory (it is named according to your service account name, something like `le-wagon-data-123456789abc.json`) + ### Configure Cloud sdk - Open the service account json file with any text editor and copy the key - - ```json + ``` # It looks like: { "type": "service_account", @@ -635,52 +609,41 @@ The browser has now saved the service account json file 🔑 in your downloads d "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/bootcamp%40kevin-bootcamp.iam.gserviceaccount.com" } ``` - - **on your Virtual Machine**, create a `~/.gcp_keys` directory, then create a json file in it: - ``` bash mkdir ~/.gcp_keys touch ~/.gcp_keys/le-wagon-de-bootcamp.json ``` - - Open the json file then store the service account json file pasting the key: - ```bash code ~/.gcp_keys/le-wagon-de-bootcamp.json ``` - ![service account json key](https://github.com/lewagon/data-engineering-setup/blob/main/images/service_account_json_key.png) ❗️Don't forget to **save** the file with `CMD` + `s` or `CTRL` + `s` - Authenticate the `gcloud` CLI with the google account you used for GCP - ```bash # Replace service_account_name@project_id.iam.gserviceaccount.com with your own SERVICE_ACCOUNT_EMAIL=service_account_name@project_id.iam.gserviceaccount.com KEY_FILE=$HOME/.gcp_keys/le-wagon-de-bootcamp.json gcloud auth activate-service-account $SERVICE_ACCOUNT_EMAIL --key-file=$KEY_FILE ``` - - List your active account and check your email address you used for GCP is present - ```bash gcloud auth list ``` - - Set your current project - ```bash # Replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456` gcloud config set project PROJECT_ID ``` - - List your active account and current project and check your project is present - ```bash gcloud config list ``` + ## Dotfiles Hackers love to refine and polish their shell and tools. We'll start with a great default configuration provided by [Le Wagon](http://github.com/lewagon/dotfiles), stored on GitHub. @@ -701,6 +664,7 @@ There seems to be a problem with the previous step (`gh auth`). There are three options, choose **one**: +
I did not attend the Web Dev or Data Science & AI or Data Analytics bootcamp at Le Wagon @@ -720,6 +684,7 @@ gh repo fork lewagon/dotfiles --clone
+
I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI or Data Analytics) but I have a new laptop @@ -734,6 +699,7 @@ mkdir -p ~/code/$GITHUB_USERNAME && cd $_ gh repo clone $GITHUB_USERNAME/dotfiles ``` + Open your terminal and go to your `dotfiles` project: ```bash @@ -786,6 +752,7 @@ git push origin master
+
I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI or Data Analytics) on the same laptop before @@ -793,6 +760,7 @@ git push origin master This means that you already forked and cloned the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Analytics bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** + Open your terminal and go to your `dotfiles` project: ```bash @@ -845,6 +813,7 @@ git push origin master
+ ### Run the dotfiles installer It's time to run the `dotfiles` installer: @@ -870,6 +839,7 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh Please now **quit** all your opened terminal windows. + ### zsh default terminal Set `zsh` as your default VS Code terminal. @@ -881,6 +851,7 @@ Set `zsh` as your default VS Code terminal. Terminal zsh profile + ## Disable SSH passphrase prompt You don't want to be asked for your passphrase every time you communicate with a distant repository. So, you need to add the plugin `ssh-agent` to `oh my zsh`: @@ -892,12 +863,12 @@ code ~/.zshrc ``` Then: - - Spot the line starting with `plugins=` - Add `ssh-agent` at the end of the plugins list :heavy_check_mark: Save the `.zshrc` file with `Ctrl` + `S` and close your text editor. + ### Install `pyenv` Ubuntu comes with an outdated version of Python that we don't want to use. You might already have installed Anaconda or something else to tinker with Python and Data Analytics packages. All of this does not really matter as we are going to do a professional setup of Python where you'll be able to switch which version you want to use whenever you type `python` in the terminal. @@ -957,6 +928,7 @@ exec zsh To check if this worked, run `python --version`. If you see `3.12.9`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). + ## Python Virtual Environment Before we start installing relevant Python packages, we will isolate the setup for the Bootcamp into a **dedicated** virtual environment. We will use a `pyenv` plugin called [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). @@ -984,6 +956,7 @@ pyenv global lewagon Great! Anytime we'll install Python package, we'll do it in that environment. + ### Python packages Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. @@ -996,10 +969,15 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + + ``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt +pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` + + + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -1008,11 +986,12 @@ Run the following lines to create a `custom.css` stylesheet in your Jupyter conf ```bash LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css +SOURCE=https://raw.githubusercontent.com/lewagon/data-analytics-setup/refs/heads/master/specs/jupyter/custom.css mkdir -p $LOCATION curl $SOURCE > $LOCATION/custom.css ``` + ## Python setup check ### Python and packages check @@ -1026,19 +1005,19 @@ cd ~/code && exec zsh Check your Python version with the following commands: ```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 +zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/python_checker.sh)" 3.12.9 ``` Run the following command to check if you successfully installed the required packages: ```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" +zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/pip_check.sh)" ``` Now run the following command to check if you can load these packages: ```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" +python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/pip_check.py)" ``` ### Jupyter check @@ -1073,7 +1052,8 @@ You can close your web browser then terminate the jupyter server with `CTRL` + ` Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. -## Kitt + + ## Kitt You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). @@ -1081,6 +1061,7 @@ Then you should receive an additional invitation from Slack, inviting you to the If you haven't, please contact your teaching team. + ## Slack [Slack](https://slack.com/) is a communication platform pretty popular in the tech industry. @@ -1091,6 +1072,7 @@ If you haven't, please contact your teaching team. :warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured. + ### Settings Launch the app and sign in to `lewagon-alumni` organization. @@ -1102,7 +1084,6 @@ Make sure you **upload a profile picture** :point_down: The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc. To ensure that everything is working fine for video calls, let's test your camera and microphone: - - Open the Slack app - Click your profile picture in the top right. - Select `Preferences` from the menu. @@ -1118,14 +1099,11 @@ To ensure that everything is working fine for video calls, let's test your camer You can also install Slack app on your phone and sign in `lewagon-alumni`! -## Setup completed! - -That's all you need for now! Some of the free trial periods on the tools we use are very short, so from now on, whenever we introduce a new tool or software, we will guide you through the sign-in and installation steps at the beginning of the day. -Ready to start? 🚀 - -## (Bonus) +## Bonus If you are done with your setup, please ask around if some classmates need some help with theirs (macOS, Linux, Windows). We will have our first lectures at 2pm and will talk about the Setup you just did + onboard you on Kitt. If you don't have a lot of experience with `git` and GitHub, please [(re-)watch this workshop](https://www.youtube.com/watch?v=Z9fIBT2NBGY) (`1.25` playback speed is fine). + + diff --git a/WINDOWS.md b/WINDOWS.md index 3f78a7f..e14bc99 100644 --- a/WINDOWS.md +++ b/WINDOWS.md @@ -6,6 +6,7 @@ Please **read them carefully and execute all commands in the following order**. Let's start :rocket: + ## GitHub account Have you signed up to GitHub? If not, [do it right away](https://github.com/join). @@ -16,16 +17,20 @@ Have you signed up to GitHub? If not, [do it right away](https://github.com/join :point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub. + ## Windows version Before we start, we need to check that the version of Windows installed on your computer is compatible with this setup instructions. ### Windows 10 or Windows 11 +> :warning: **Note on Windows 10 and security** +> +> The Le Wagon bootcamp setup works on Windows 10. That said, we highly recommend to upgrade to Windows 11. Since October 14th, 2025, Microsoft has ended support for Windows 10, which means it will no longer receive security updates, potentially putting your machine at risk. For more details, read [Microsoft's guide](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). In case your machine can't run Windows 11, consider switching to Ubuntu. + To be able to set up your computer, you need to have **Windows 10 or Windows 11** installed. To check your Windows version: - - Press `Windows` + `R` - Type `winver` - Press `Enter` @@ -57,13 +62,13 @@ If the first words of this window are **Windows 10**, check the **Version number Activate Windows Update Service to fix Updates Some antiviruses and pieces of software deactivate the Update service we need, resulting in the error you see. Let's fix that! - - Press `Windows` + `R` - - Type `services.msc` - - Press `Enter` - - Double Click `Windows Update Service` - - Set its `Startup` to `Automatic` - - Click on `Start` - - Click on `Ok` + - Press `Windows` + `R` + - Type `services.msc` + - Press `Enter` + - Double Click `Windows Update Service` + - Set its `Startup` to `Automatic` + - Click on `Start` + - Click on `Ok` Then let's try updates again!
@@ -79,12 +84,12 @@ If the first words of this window are **Windows 10**, check the **Version number
+ ## Virtualization We need to ensure that the Virtualization options are enabled in the BIOS of your computer. For many computers, this is already the case. Let's check: - - Press `Windows` + `R` - Type `taskmgr` - Press `Enter` @@ -101,26 +106,27 @@ For many computers, this is already the case. Let's check: Activate Virtualization We need to access the BIOS / UEFI of the computer to activate it. - - Press `Windows + R` - - Type `shutdown.exe /r /o /t 1` - - Press `Enter` - - Wait for the computer to shutdown - - Click on `Troubleshoot` - - Click on `Advanced Options` - - Click on `UEFI Firmware Settings` - - Click on `Restart` + - Press `Windows + R` + - Type `shutdown.exe /r /o /t 1` + - Press `Enter` + - Wait for the computer to shutdown + - Click on `Troubleshoot` + - Click on `Advanced Options` + - Click on `UEFI Firmware Settings` + - Click on `Restart` You need to activate the virtualization option for your processor here: - - Most of the time, in the advanced settings, the CPU settings, or the Northbridge settings - - The option can be called differently according to your computer: + - Most of the time, in the advanced settings, the CPU settings, or the Northbridge settings + - The option can be called differently according to your computer: - Intel: `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`... - AMD: `SVM Mode` or `AMD-V` - - Save the changes after activation and reboot the computer through the appropriate option + - Save the changes after activation and reboot the computer through the appropriate option
+ ## Windows Subsystem for Linux (WSL) -WSL is the development environment we are using to run Ubuntu. [You can learn more about WSL here](https://docs.microsoft.com/en-us/windows/wsl/faq). +WSL is the development environment we are using to run Ubuntu. You can learn more about WSL [here](https://docs.microsoft.com/en-us/windows/wsl/faq). We will install WSL 2 and Ubuntu in one command through the Windows Command Prompt. @@ -133,7 +139,6 @@ We will install WSL 2 and Ubuntu in one command through the Windows Command Prom :warning: You may have to accept the UAC confirmation about the privilege elevation. A black terminal window will appear: - - Copy the following command (`Ctrl` + `C`) - Paste it into the terminal window (`Ctrl` + `V` or by right-clicking in the window) - Run it by pressing `Enter` @@ -150,7 +155,7 @@ wsl --install Troubleshooting for Windows 10 (only if needed, check with a TA) -### For Windows 10 < 2004: install WSL 1 first +#### For Windows 10 < 2004: install WSL 1 first :warning: In the following instruction, please be aware of the `Ctrl` + `Shift` + `Enter` key stroke to execute **Windows PowerShell** with administrator privileges instead of just clicking on `Ok`or pressing `Enter`. @@ -161,7 +166,6 @@ wsl --install :warning: You may have to accept the UAC confirmation about the privilege elevation. A blue terminal window will appear: - - Copy the following commands one by one (`Ctrl` + `C`) - Paste them into the PowerShell window (`Ctrl` + `V` or by right-clicking in the window) - Run them by pressing `Enter` @@ -205,7 +209,6 @@ Once your computer has restarted, we need to download the WSL2 installer. If you are running Windows 10, we will set WSL default version to 2. Now that WSL 2 is installed, let's make it the default version: - - Press `Windows` + `R` - Type `cmd` - Press `Enter` @@ -236,6 +239,7 @@ wsl --set-default-version 2 + ## Ubuntu ### Installation @@ -263,9 +267,9 @@ If you are running Windows 10, let's install Ubuntu throught the Microsoft Store Uninstall wrong versions of Ubuntu To uninstall a wrong version of Ubuntu, you just have to go to the Installed Program List of Windows 10: - - Press `Windows` + `R` - - Type `ms-settings:appsfeatures` - - Press `Enter` + - Press `Windows` + `R` + - Type `ms-settings:appsfeatures` + - Press `Enter` Find the software to uninstall and click on the uninstall button. @@ -277,17 +281,17 @@ Once the installation is finished, the `Get` button becomes a `Open` button: cli ### First launch At first launch, you will be asked some information: - - Choose a **username**: - - one word - - lowercase - - no special characters - - for example: `lewagon` or your `firstname` + - one word + - lowercase + - no special characters + - for example: `lewagon` or your `firstname` - Choose a **password** - Confirm your password :warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`. + ### Check the WSL version of Ubuntu - Press `Windows` + `R` @@ -320,14 +324,14 @@ wsl -l -v
Check for Uncompressed Files - - Press `Windows` + `R` - - Type `%localappdata%\Packages` - - Press `Enter` - - Open the folder named `CanonicalGroupLimited.UbuntuonWindows...` - - Right Click on the `LocalState` folder - - Click on `Properties` - - Click on `Advanced` - - Make sure that the option `Compress content` is **not** ticked, then click on `Ok`. + - Press `Windows` + `R` + - Type `%localappdata%\Packages` + - Press `Enter` + - Open the folder named `CanonicalGroupLimited.UbuntuonWindows...` + - Right Click on the `LocalState` folder + - Click on `Properties` + - Click on `Advanced` + - Make sure that the option `Compress content` is **not** ticked, then click on `Ok`. Apply changes to this folder only and try to convert the Ubuntu WSL version again. @@ -350,36 +354,6 @@ It should return the username you chose before. :x: It if says `root`, **contact a TA** before continuing! -### Check the locale - -The locale is a mechanism allowing to customize programs to your language and country. - -Let's verify that the default locale is set to English, please type this in the Ubuntu terminal: - -```bash -locale -``` - -If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale: - -```bash -sudo locale-gen en_US.UTF-8 -``` - -If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following: - -
- Generate locale - -Please, run this lines in your terminal. - -```bash -sudo update-locale LANG=en_US.UTF8 -sudo apt-get update -sudo apt-get install language-pack-en language-pack-en-base manpages -``` - -
## Visual Studio Code @@ -420,6 +394,7 @@ code . :x: Otherwise, please **contact a teacher** + ## Windows Terminal ### Installation @@ -447,9 +422,9 @@ If you are running Windows 10, let's install Windows Terminal, a real modern ter To uninstall a wrong version of Windows Terminal, you just have to go to the Installed Program List of Windows 10: - - Press `Windows` + `R` - - Type `ms-settings:appsfeatures` - - Press `Enter` + - Press `Windows` + `R` + - Type `ms-settings:appsfeatures` + - Press `Enter` Find the software to uninstall and click on the uninstall button.
@@ -474,14 +449,13 @@ It should open the terminal settings: You may see an orange circle rather than a penguin as the logo for Ubuntu. -We have circled in red the part you need to change: +We have circled in red the part you need to add: ![Windows Terminal JSON settings file](https://github.com/lewagon/setup/blob/master/images/windows_terminal_settings_json.png) -First, let's ask Ubuntu to start directly inside your Ubuntu Home Directory instead of the Windows one: +First, let's ask Ubuntu to start directly inside your Ubuntu Home Directory instead of the Windows one. -- Locate the entry with both `"name": "Ubuntu",` and `"hidden": false,` -- Add the following line after it: +- Place this line inside the { } block that contains "name": "Ubuntu" (like in the screenshot): ```bash "commandline": "wsl.exe ~", @@ -491,11 +465,11 @@ First, let's ask Ubuntu to start directly inside your Ubuntu Home Directory inst Then, let's disable warnings for copy-pasting commands between Windows and Ubuntu: -- Locate the line `"defaultProfile": "{2c4de342-...}"` +- Locate the line "defaultProfile": "{2c4de342-...}" - Add the following line after it: ```bash -"multiLinePasteWarning": false, +"warning.multiLinePaste": false, ``` :warning: Do not forget the comma at the end of the line! @@ -508,6 +482,8 @@ This terminal has tabs: you can choose to open a new terminal tab by clicking on **From now on, every time we will refer to the terminal or the console it will be this one.** DO NOT use any other terminal anymore. + + ## VS Code Extensions ### Installation @@ -536,8 +512,39 @@ Here is a list of the extensions you are installing: - [Jupyter](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) - [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite) + ## Command line tools +### Check the locale + +The locale is a mechanism allowing to customize programs to your language and country. + +Let's verify that the default locale is set to English, please type this in the Ubuntu terminal: + +```bash +locale +``` + +If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale: + +```bash +sudo locale-gen en_US.UTF-8 +``` + +If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following: + +
+ Generate locale + +Please, run this lines in your terminal. + +```bash +sudo update-locale LANG=en_US.UTF8 +sudo apt-get update +sudo apt-get install language-pack-en language-pack-en-base manpages +``` +
+ ### Zsh & Git Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), we will use `zsh`. @@ -545,7 +552,6 @@ Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_ We will also use [`git`](https://git-scm.com/), a command line software used for version control. Let's install them, along with other useful tools: - - Open an **Ubuntu terminal** - Copy and paste the following commands: @@ -594,6 +600,7 @@ gh --version :x: Otherwise, please **contact a teacher** + ## Oh-my-zsh Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/). @@ -614,6 +621,7 @@ At the end your terminal should look like this: :x: Otherwise, please **ask for a teacher** + ## Linking your default browser to Ubuntu To be sure that you can interact with your browser installed on Windows from your Ubuntu terminal, we need to set it as your default browser there. @@ -640,15 +648,19 @@ If it does not, you can follow [these instructions](https://github.com/lewagon/s Do not hesitate to **contact a teacher**. + ## direnv [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -661,7 +673,7 @@ We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol t First in order to **login**, copy-paste the following command in your terminal: -:warning: **DO NOT edit the `email`** +:warning: **DO NOT edit the `email`** — Even though `user:email` looks like a placeholder for your actual email address, it isn't — do not replace it. ```bash gh auth login -s 'user:email' -w --git-protocol ssh @@ -673,7 +685,9 @@ gh auth login -s 'user:email' -w --git-protocol ssh If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`. -- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`. +- `Enter a passphrase for your new SSH key (Optional)`: + - **FOR MOST PEOPLE:** Just press `Enter` to skip. You don't need a passphrase for the bootcamp and it would prompt you every time you use the key. There is a risk, however, that if someone steals your laptop, they could then push to GitHub. + - **IF SECURITY IS REALLY IMPORTANT TO YOU:** Enter a passphrase of your choice and press `Enter`. It's _really_ important that if you enter a passphrase, you write it down somewhere immediately and do not lose/forget it. You will need to enter this frequently. - `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`. @@ -700,9 +714,11 @@ gh auth status :x: If not, **contact a teacher**. + ## Google Cloud CLI Install the `gcloud` CLI to communicate with [Google Cloud Platform](https://cloud.google.com/) through your terminal: + ```bash echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list sudo apt-get install apt-transport-https ca-certificates gnupg @@ -713,6 +729,7 @@ sudo apt-get install google-cloud-sdk-app-engine-python 👉 [Install documentation](https://cloud.google.com/sdk/docs/install#deb) + ## Dotfiles Hackers love to refine and polish their shell and tools. We'll start with a great default configuration provided by [Le Wagon](http://github.com/lewagon/dotfiles), stored on GitHub. @@ -733,6 +750,7 @@ There seems to be a problem with the previous step (`gh auth`). There are three options, choose **one**: +
I did not attend the Web Dev or Data Science & AI or Data Analytics bootcamp at Le Wagon @@ -752,6 +770,7 @@ gh repo fork lewagon/dotfiles --clone
+
I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI or Data Analytics) but I have a new laptop @@ -766,6 +785,7 @@ mkdir -p ~/code/$GITHUB_USERNAME && cd $_ gh repo clone $GITHUB_USERNAME/dotfiles ``` + Open your terminal and go to your `dotfiles` project: ```bash @@ -818,6 +838,7 @@ git push origin master
+
I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI or Data Analytics) on the same laptop before @@ -825,6 +846,7 @@ git push origin master This means that you already forked and cloned the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Analytics bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** + Open your terminal and go to your `dotfiles` project: ```bash @@ -877,6 +899,7 @@ git push origin master
+ ### Run the dotfiles installer It's time to run the `dotfiles` installer: @@ -902,6 +925,7 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh Please now **quit** all your opened terminal windows. + ## Disable SSH passphrase prompt You don't want to be asked for your passphrase every time you communicate with a distant repository. So, you need to add the plugin `ssh-agent` to `oh my zsh`: @@ -913,12 +937,12 @@ code ~/.zshrc ``` Then: - - Spot the line starting with `plugins=` - Add `ssh-agent` at the end of the plugins list :heavy_check_mark: Save the `.zshrc` file with `Ctrl` + `S` and close your text editor. + ## Installing Python (with [`pyenv`](https://github.com/pyenv/pyenv)) ### Uninstall `conda` @@ -931,8 +955,10 @@ Check if you have `conda` installed on your machine: conda list ``` + If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. +
conda uninstall instructions @@ -949,11 +975,13 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line + - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` @@ -961,6 +989,7 @@ rm -rf ~/.anaconda_backup
+ ### Install `pyenv` Ubuntu comes with an outdated version of Python that we don't want to use. You might already have installed Anaconda or something else to tinker with Python and Data Analytics packages. All of this does not really matter as we are going to do a professional setup of Python where you'll be able to switch which version you want to use whenever you type `python` in the terminal. @@ -1020,6 +1049,7 @@ exec zsh To check if this worked, run `python --version`. If you see `3.12.9`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). + ## Python Virtual Environment Before we start installing relevant Python packages, we will isolate the setup for the Bootcamp into a **dedicated** virtual environment. We will use a `pyenv` plugin called [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). @@ -1047,6 +1077,7 @@ pyenv global lewagon Great! Anytime we'll install Python package, we'll do it in that environment. + ### Python packages Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. @@ -1059,10 +1090,15 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` + + + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -1076,6 +1112,8 @@ mkdir -p $LOCATION curl $SOURCE > $LOCATION/custom.css ``` + + ### Configuring Jupyter Notebook to open in your browser First, let's configure your default browser again. We did this before, but when we installed the dotfiles it got removed. Not a problem, run this command to configure the settings again: @@ -1116,6 +1154,7 @@ If it is not the case, please call a TA. To stop the Jupyter server in the terminal, press `Ctrl` + `C`, enter y, then press Enter. + ## Python setup check ### Python and packages check @@ -1176,6 +1215,7 @@ You can close your web browser then terminate the jupyter server with `CTRL` + ` Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. + ## Insomnia > ℹ️ **Why?** Insomnia is one of the best-known API testing tools, and it will be useful in our Introduction to API course. @@ -1186,6 +1226,7 @@ Here you have it! A complete python virtual env with all the third-party package - Install Insomnia + ## Windows settings ### Exchange files between Windows and Ubuntu @@ -1193,10 +1234,9 @@ Here you have it! A complete python virtual env with all the third-party package We need an easy way to transfer files from Windows to Ubuntu and vice versa. In order to do that, let's create shortcuts to Ubuntu directories in the Windows **File Explorer**: - - Open the Windows File Explorer (or use the shortcut `WIN` + `E`) - In the Address Bar, enter `\\wsl$\` (or `\\wsl$\Ubuntu` if it does not work) -- You now have access to the Ubuntu file system +- You now have acces to the Ubuntu file system - Dive into the Ubuntu file system in order to look for directories of interest - Drag the desired folders into the Address Bar in order to create shortcuts @@ -1205,7 +1245,6 @@ In order to do that, let's create shortcuts to Ubuntu directories in the Windows ### Open the Windows File Explorer from the Ubuntu terminal Another option to move files around is to open the Windows **File Explorer** from the Ubuntu terminal: - - Open an Ubuntu terminal - Go to the directory you wish to explore - Run the `explorer.exe .` command (alternatively, use `wslview .`) @@ -1218,7 +1257,6 @@ Another option to move files around is to open the Windows **File Explorer** fro You might want to figure out the exact location of a Windows directory in the Ubuntu file system, or the other way around. In order to convert a Windows path to and from an Ubuntu path: - - Open an Ubuntu terminal - Use the `wslpath "C:\Program Files"` command in order to translate a Windows path into an Ubuntu path - Use the `wslpath -w "/home"` command in order to translate an Ubuntu path into a Windows path @@ -1235,19 +1273,20 @@ To pin an app to your taskbar, launch the app, right-click on the icon in the ta ![How to pin an app to the taskbar in Windows](https://github.com/lewagon/setup/blob/master/images/windows_taskbar.png) You must pin: - - Your terminal - Your file explorer - VS Code - Your Internet browser - Slack + ## Visual C++ Redistributable Some Python packages require a compiler to function properly. Let's install one: [For x64 systems](https://aka.ms/vs/16/release/vc_redist.x64.exe) + ## Google Cloud Platform setup [GCP](https://cloud.google.com/) is a cloud solution that you are going to use in order to deploy your Machine Learning-based products to production. @@ -1377,10 +1416,12 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP + ```bash gcloud auth login --no-launch-browser ``` + - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present @@ -1475,6 +1516,7 @@ An alternate way to navigate to the Service Accounts page is from the following: - The browser has now saved the service account json file 🔑 in your downloads directory (it is named according to your service account name, something like `le-wagon-data-123456789abc.json`). + We will now move the service account json file from your Windows disk to the Ubuntu disk. This will allow the development tools in Ubuntu to access to the resources of your GCP account. First, let's create a directory in which we will store the file. @@ -1555,6 +1597,8 @@ code ~/.zshrc in the Terminal! 😄 + +
ℹ️ How to find the absolute path of a file? You can drag and drop the file in your terminal. @@ -1606,13 +1650,13 @@ gcloud projects get-iam-policy PROJECT_ID \ Troubleshooting - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` - - Make sure that billing is enabled for your Google Cloud Platform project https://cloud.google.com/billing/docs/how-to/modify-project - + - Make sure that billing is enabled for your Google Cloud Platform project [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project)
🏁 You are done with the GCP setup! -## Kitt + + ## Kitt You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). @@ -1620,6 +1664,7 @@ Then you should receive an additional invitation from Slack, inviting you to the If you haven't, please contact your teaching team. + ## Slack [Slack](https://slack.com/) is a communication platform pretty popular in the tech industry. @@ -1630,6 +1675,7 @@ If you haven't, please contact your teaching team. :warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured. + ### Settings Launch the app and sign in to `lewagon-alumni` organization. @@ -1641,7 +1687,6 @@ Make sure you **upload a profile picture** :point_down: The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc. To ensure that everything is working fine for video calls, let's test your camera and microphone: - - Open the Slack app - Click your profile picture in the top right. - Select `Preferences` from the menu. @@ -1657,14 +1702,11 @@ To ensure that everything is working fine for video calls, let's test your camer You can also install Slack app on your phone and sign in `lewagon-alumni`! -## Setup completed! -That's all you need for now! Some of the free trial periods on the tools we use are very short, so from now on, whenever we introduce a new tool or software, we will guide you through the sign-in and installation steps at the beginning of the day. - -Ready to start? 🚀 - -## (Bonus) +## Bonus If you are done with your setup, please ask around if some classmates need some help with theirs (macOS, Linux, Windows). We will have our first lectures at 2pm and will talk about the Setup you just did + onboard you on Kitt. If you don't have a lot of experience with `git` and GitHub, please [(re-)watch this workshop](https://www.youtube.com/watch?v=Z9fIBT2NBGY) (`1.25` playback speed is fine). + + diff --git a/WINDOWS_keep_current.md b/WINDOWS_keep_current.md index ef9d520..9f15539 100644 --- a/WINDOWS_keep_current.md +++ b/WINDOWS_keep_current.md @@ -87,10 +87,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : + ``` bash cd $(pyenv root) && git pull ``` + Install the current python version : ```bash @@ -141,10 +143,14 @@ pyenv versions pip install -U pip ``` + + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` + + ## GCP Make sure that the `gcloud` command is linked to the email address of your Google Cloud Platform account : @@ -231,6 +237,7 @@ Make sure that the file contains the correct : 👉 If this does not display anything or if the email inside of the file is not the one of your service account, go back to the setup + ## Python setup check ### Python and packages check @@ -290,3 +297,5 @@ It should output `3.12.9` followed by some more details. If not, check with a TA You can close your web browser then terminate the jupyter server with `CTRL` + `C`. Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. + + diff --git a/_partials/chrome.md b/_partials/chrome.md index 6a69837..7bb6aef 100644 --- a/_partials/chrome.md +++ b/_partials/chrome.md @@ -1,3 +1,4 @@ + ## Chrome - your browser Install the Google Chrome browser if you haven't got it already and set it as a __default browser__. diff --git a/_partials/conda_uninstall.md b/_partials/conda_uninstall.md index cb967a2..e16c91b 100644 --- a/_partials/conda_uninstall.md +++ b/_partials/conda_uninstall.md @@ -10,15 +10,13 @@ Check if you have `conda` installed on your machine: conda list ``` -$MAC_START +{% if os == "macos" %} If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install pre-requisites** section. -$MAC_END -$LINUX_START +{% elsif os == "linux" %} If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. -$WINDOWS_END +{% endif %}
conda uninstall instructions @@ -36,20 +34,19 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup -$MAC_START +{% if os == "macos" %} rm -rf ~/opt -$MAC_END +{% endif %} ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line -$MAC_START +{% if os == "macos" %} - Save the file with `CMD` + `s` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} - Save the file with `CTRL` + `s` -$LINUX_END +{% endif %} - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` diff --git a/_partials/direnv.md b/_partials/direnv.md index 3f54c9a..2e43422 100644 --- a/_partials/direnv.md +++ b/_partials/direnv.md @@ -2,27 +2,19 @@ [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. -$MAC_START - +{% if os == "macos" %} ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` - -$MAC_END -$WINDOWS_START - +{% elsif os == "windows" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` - -$WINDOWS_END -$LINUX_START - +{% elsif os == "linux" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` - -$LINUX_END +{% endif %} diff --git a/_partials/dotfiles_merge_upstream.md b/_partials/dotfiles_merge_upstream.md index 3f0efb4..96b5228 100644 --- a/_partials/dotfiles_merge_upstream.md +++ b/_partials/dotfiles_merge_upstream.md @@ -30,11 +30,11 @@ Time to merge the changes from `lewagon/dotfiles` into yours: First abort the merge: `git merge --abort`. - Run ` .` + Run `{{ CODE_EDITOR_CMD }} .` - In , open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. + In {{ CODE_EDITOR }}, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. - Still in , open the `zprofile` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Save to disk. + Still in {{ CODE_EDITOR }}, open the `zprofile` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Save to disk. Back in the terminal, run a `git diff` and check if this didn't remove any personal configuration setting that you wanted to keep. diff --git a/_partials/es/conda_uninstall.md b/_partials/es/conda_uninstall.md index a61aa84..72dbaa7 100644 --- a/_partials/es/conda_uninstall.md +++ b/_partials/es/conda_uninstall.md @@ -9,15 +9,13 @@ Chequea si tienes `conda` instalado en tu computadora: ```bash conda list ``` -$MAC_START +{% if os == "macos" %} Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. -$MAC_END -$LINUX_START +{% elsif os == "linux" %} Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. -$WINDOWS_END +{% endif %}
Instrucciones de desinstalación conda @@ -32,19 +30,18 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup -$MAC_START +{% if os == "macos" %} rm -rf ~/opt -$MAC_END +{% endif %} ``` - Elimina el directorio Anaconda de tu `.bash_profile` - Abre el archivo con `code ~/.bash_profile` - Si el archivo abre, busca la línea que coincida con el siguiente patrón `export PATH="/path/to/anaconda3/bin:$PATH"` y eliminala -$MAC_START +{% if os == "macos" %} - Guarda el archivo con `CMD` + `s` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} - Guarda el archivo con `CTRL` + `s` -$LINUX_END +{% endif %} - Reinicia la terminal con `exec zsh` - Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - Abre el archivo con `code ~/.zshrc` diff --git a/_partials/es/direnv.md b/_partials/es/direnv.md index 28901f9..989ab65 100644 --- a/_partials/es/direnv.md +++ b/_partials/es/direnv.md @@ -2,21 +2,19 @@ [direnv](https://direnv.net/) es una extensión del shell. Facilita trabajar con variables de entorno por proyecto, lo cual será útil para customizar el comportamiento de tu código. -$MAC_START +{% if os == "macos" %} ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$LINUX_END +{% endif %} diff --git a/_partials/es/dotfiles_merge_upstream.md b/_partials/es/dotfiles_merge_upstream.md index 9a26397..014bc39 100644 --- a/_partials/es/dotfiles_merge_upstream.md +++ b/_partials/es/dotfiles_merge_upstream.md @@ -29,11 +29,11 @@ Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: Primero aborta la merge: `git merge --abort`. - Ejecuta ` .` + Ejecuta `{{ CODE_EDITOR_CMD }} .` - En , abre el archivo zshrc. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Luego guárdalo en el disco. + En {{ CODE_EDITOR }}, abre el archivo zshrc. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Luego guárdalo en el disco. - Aún en , abre el archivo `zprofile`. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Luego guárdalo en el disco. + Aún en {{ CODE_EDITOR }}, abre el archivo `zprofile`. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Luego guárdalo en el disco. Regresa a la terminal y ejecuta un `git diff` y verifica que esto no haya eliminado ninguna configuración personal que quisieras conservar. diff --git a/_partials/es/keep_current.md b/_partials/es/keep_current.md index bd995d5..fe56bc5 100644 --- a/_partials/es/keep_current.md +++ b/_partials/es/keep_current.md @@ -87,32 +87,24 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Actualiza pyenv: -$MAC_START - +{% if os == "macos" %} ``` bash brew update && brew upgrade pyenv ``` - -$MAC_END -$LINUX_START - +{% elsif os == "linux" %} ``` bash cd $(pyenv root) && git pull ``` - -$LINUX_END -$WINDOWS_START - +{% elsif os == "windows" %} ``` bash cd $(pyenv root) && git pull ``` - -$WINDOWS_END +{% endif %} Instala la versión actual de python: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` 👉 Asegúrate de que el comando se ejecute completamente y luego **reinicia tu terminal**. @@ -126,7 +118,7 @@ pyenv virtualenv-delete lewagon_current Crea un nuevo ambiente virtual: ```bash -pyenv virtualenv lewagon_current +pyenv virtualenv {{ PYTHON_VERSION }} lewagon_current ``` Define el nuevo ambiente virtual como predeterminado: @@ -145,8 +137,8 @@ pyenv versions ``` bash system - - /envs/lewagon_current + {{ PYTHON_VERSION }} + {{ PYTHON_VERSION }}/envs/lewagon_current 3.7.6 3.7.6/envs/lewagon * lewagon_current @@ -159,7 +151,7 @@ pyenv versions pip install -U pip ``` -$MAC_START +{% if os == "macos" %} Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
@@ -181,21 +173,19 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/ma ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} ## GCP diff --git a/_partials/es/osx_python.md b/_partials/es/osx_python.md index 7bcafb0..1bd2366 100644 --- a/_partials/es/osx_python.md +++ b/_partials/es/osx_python.md @@ -36,7 +36,7 @@ exec zsh Instala la [última versión estable de Python](https://www.python.org/doc/versions/) aceptada en el currículum de Le Wagon: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` Este comando puede tomar un tiempo en ejecutarse. Esto es completamente normal. ¡No dudes en ayudar a los estudiantes que estén sentados cerca de ti! @@ -61,7 +61,7 @@ export CPPFLAGS="-I/usr/local/opt/zlib/include" Luego trata de instalar Python nuevamente: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` Es posible que aparezca otro error relacionado con `bzip2`. Esto lo puedes ignorar y continuar al paso siguiente. @@ -72,8 +72,8 @@ Es posible que aparezca otro error relacionado con `bzip2`. Esto lo puedes ignor OK. Cuando este comando termine de ejecutarse, le diremos al sistema que use esta versión de Python **por defecto**. Esto se hace con: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -Para verificar si esto ha funcionado, ejecuta `python --version`. Si ves ``, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio `pyenv versions` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). +Para verificar si esto ha funcionado, ejecuta `python --version`. Si ves `{{ PYTHON_VERSION }}`, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio `pyenv versions` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). diff --git a/_partials/es/pip.md b/_partials/es/pip.md index 0b51906..06032ce 100644 --- a/_partials/es/pip.md +++ b/_partials/es/pip.md @@ -10,7 +10,7 @@ pip install --upgrade pip Ahora instala algunos paquetes para las primeras semanas del programa: -$MAC_START +{% if os == "macos" %} Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
@@ -32,18 +32,16 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/ma ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} diff --git a/_partials/es/python_checkup.md b/_partials/es/python_checkup.md index cef2eea..f204422 100644 --- a/_partials/es/python_checkup.md +++ b/_partials/es/python_checkup.md @@ -11,19 +11,19 @@ cd ~/code && exec zsh Verifica tu versión de Python con los siguientes comandos: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PYTHON_CHECKER_URL }})" {{ PYTHON_VERSION }} ``` Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PIP_CHECKER_URL }})" ``` Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: ```bash -python -c "$(curl -fsSL )" +python -c "$(curl -fsSL {{ PIP_LOADER_URL }})" ``` ### Chequeo de Jupyter @@ -52,7 +52,7 @@ Asegúrate de que estés usando la versión correcta de python en el notebook. A import sys; sys.version ``` -Debería mostrar `` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. +Debería mostrar `{{ PYTHON_VERSION }}` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. diff --git a/_partials/es/ubuntu_python.md b/_partials/es/ubuntu_python.md index a2ffa5f..1a90ee9 100644 --- a/_partials/es/ubuntu_python.md +++ b/_partials/es/ubuntu_python.md @@ -23,7 +23,7 @@ python3-dev Instala la [última versión estable de Python](https://www.python.org/doc/versions/) que sea aceptada en el currículum de Le Wagon: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` Este comando puede tomar un tiempo en ejecutarse. Esto es completamente normal. ¡No dudes en ayudar a los estudiantes que estén sentados cerca de ti! @@ -31,8 +31,8 @@ Este comando puede tomar un tiempo en ejecutarse. Esto es completamente normal. OK. Cuando este comando termine de ejecutarse, le diremos al sistema que use esta versión de Python **por defecto**. Esto se hace con: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -Para verificar que esto haya funcionado, ejecuta `python --version`. Si ves ``, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio de `versiones de pyenv` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). +Para verificar que esto haya funcionado, ejecuta `python --version`. Si ves `{{ PYTHON_VERSION }}`, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio de `versiones de pyenv` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). diff --git a/_partials/es/virtualenv.md b/_partials/es/virtualenv.md index 577d67f..1f00a28 100644 --- a/_partials/es/virtualenv.md +++ b/_partials/es/virtualenv.md @@ -14,7 +14,7 @@ exec zsh Crea el entorno virtual que usaremos durante todo el bootcamp: ```bash -pyenv virtualenv lewagon +pyenv virtualenv {{ PYTHON_VERSION }} lewagon ``` Define el entorno virtual con lo siguiente: diff --git a/_partials/gcp_setup.md b/_partials/gcp_setup.md index d6cda79..2591573 100644 --- a/_partials/gcp_setup.md +++ b/_partials/gcp_setup.md @@ -127,27 +127,19 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP -$MAC_START - +{% if os == "macos" %} ```bash gcloud auth login ``` - -$MAC_END -$LINUX_START - +{% elsif os == "linux" %} ```bash gcloud auth login ``` - -$LINUX_END -$WINDOWS_START - +{% elsif os == "windows" %} ```bash gcloud auth login --no-launch-browser ``` - -$WINDOWS_END +{% endif %} - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present diff --git a/_partials/keep_current.md b/_partials/keep_current.md index dc4cd58..70a9710 100644 --- a/_partials/keep_current.md +++ b/_partials/keep_current.md @@ -87,32 +87,24 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : -$MAC_START - +{% if os == "macos" %} ``` bash brew update && brew upgrade pyenv ``` - -$MAC_END -$LINUX_START - +{% elsif os == "linux" %} ``` bash cd $(pyenv root) && git pull ``` - -$LINUX_END -$WINDOWS_START - +{% elsif os == "windows" %} ``` bash cd $(pyenv root) && git pull ``` - -$WINDOWS_END +{% endif %} Install the current python version : ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` 👉 Make sure that the command completes correctly and **restart your terminal** @@ -126,7 +118,7 @@ pyenv virtualenv-delete lewagon_current Create a new virtual environment : ```bash -pyenv virtualenv lewagon_current +pyenv virtualenv {{ PYTHON_VERSION }} lewagon_current ``` Set the new virtual environment as default : @@ -145,8 +137,8 @@ pyenv versions ``` bash system - - /envs/lewagon_current + {{ PYTHON_VERSION }} + {{ PYTHON_VERSION }}/envs/lewagon_current 3.10.6 3.10.6/envs/lewagon * lewagon_current @@ -159,7 +151,7 @@ pyenv versions pip install -U pip ``` -$MAC_START +{% if os == "macos" %} If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -181,21 +173,19 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/ma ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} ## GCP diff --git a/_partials/osx_python.md b/_partials/osx_python.md index dc60d9b..2ffe182 100644 --- a/_partials/osx_python.md +++ b/_partials/osx_python.md @@ -36,7 +36,7 @@ exec zsh Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! @@ -53,7 +53,7 @@ source ~/.zprofile Then try to install Python again: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` If `pyenv` is still not found, contact a teacher. @@ -80,7 +80,7 @@ export CPPFLAGS="-I/usr/local/opt/zlib/include" Then try to install Python again: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` It could raise another error about `bzip2`, you can ignore it and continue to the next step. @@ -91,8 +91,8 @@ It could raise another error about `bzip2`, you can ignore it and continue to th OK once this command is complete, we are going to tell the system to use this version of Python **by default**. This is done with: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -To check if this worked, run `python --version`. If you see ``, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). +To check if this worked, run `python --version`. If you see `{{ PYTHON_VERSION }}`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). diff --git a/_partials/pip.md b/_partials/pip.md index 1bfff4a..0d1d28c 100644 --- a/_partials/pip.md +++ b/_partials/pip.md @@ -10,7 +10,7 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: -$MAC_START +{% if os == "macos" %} If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -32,18 +32,16 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/ma ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} diff --git a/_partials/python_checkup.md b/_partials/python_checkup.md index 43b7515..aa2bf61 100644 --- a/_partials/python_checkup.md +++ b/_partials/python_checkup.md @@ -11,19 +11,19 @@ cd ~/code && exec zsh Check your Python version with the following commands: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PYTHON_CHECKER_URL }})" {{ PYTHON_VERSION }} ``` Run the following command to check if you successfully installed the required packages: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PIP_CHECKER_URL }})" ``` Now run the following command to check if you can load these packages: ```bash -python -c "$(curl -fsSL )" +python -c "$(curl -fsSL {{ PIP_LOADER_URL }})" ``` ### Jupyter check @@ -52,7 +52,7 @@ Make sure that you are running the correct python version in the notebook. Open import sys; sys.version ``` -It should output `` followed by some more details. If not, check with a TA. +It should output `{{ PYTHON_VERSION }}` followed by some more details. If not, check with a TA. You can close your web browser then terminate the jupyter server with `CTRL` + `C`. diff --git a/_partials/ubuntu_python.md b/_partials/ubuntu_python.md index 63736dc..6d8b760 100644 --- a/_partials/ubuntu_python.md +++ b/_partials/ubuntu_python.md @@ -23,7 +23,7 @@ python3-dev Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! @@ -40,7 +40,7 @@ source ~/.zprofile Then try to install Python again: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` If `pyenv` is still not found, contact a teacher. @@ -51,8 +51,8 @@ If `pyenv` is still not found, contact a teacher. OK once this command is complete, we are going to tell the system to use this version of Python **by default**. This is done with: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -To check if this worked, run `python --version`. If you see ``, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). +To check if this worked, run `python --version`. If you see `{{ PYTHON_VERSION }}`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). diff --git a/_partials/virtualenv.md b/_partials/virtualenv.md index e7b9ca1..87a8142 100644 --- a/_partials/virtualenv.md +++ b/_partials/virtualenv.md @@ -14,7 +14,7 @@ exec zsh Let's create the virtual environment we are going to use during the whole bootcamp: ```bash -pyenv virtualenv lewagon +pyenv virtualenv {{ PYTHON_VERSION }} lewagon ``` Let's now set the virtual environment with: diff --git a/_partials/vscode_extensions.md b/_partials/vscode_extensions.md index 73799a3..69039c6 100644 --- a/_partials/vscode_extensions.md +++ b/_partials/vscode_extensions.md @@ -1,3 +1,4 @@ + ## VS Code Extensions ### Installation diff --git a/build.rb b/build.rb index 701d8d4..702f5a5 100755 --- a/build.rb +++ b/build.rb @@ -1,260 +1,22 @@ -require 'open-uri' -#!/usr/bin/env ruby -wU -CONSTANTS = { - 'PYTHON_VERSION' => '3.12.9', - 'PYTHON_CHECKER_URL' => 'https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/python_checker.sh', - 'PIP_CHECKER_URL' => 'https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/pip_check.sh', - 'PIP_LOADER_URL' => 'https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/pip_check.py', - 'CODE_EDITOR' => 'VS Code', - 'CODE_EDITOR_CMD' => 'code' -} - -# NOTE(ssaunier): This script needs https://github.com/lewagon/setup to be cloned as well -MAC_OS = %w[ - intro - setup/github - osx_silicon - setup/macos_command_line_tools - homebrew - setup/macos_vscode - vscode_extensions - setup/oh_my_zsh - direnv - setup/gh_cli - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - conda_uninstall - osx_python - virtualenv - pip - nbextensions - python_checkup - insomnia - gcp_cli_setup - gcp_setup - gcp_setup_mid - gcp_setup_end - kitt - setup/macos_slack - setup/slack_settings - setup/macos_settings - bonus -].freeze - -MAC_OS_KC = %w[ - keep_current - python_checkup -].freeze - -WINDOWS = %w[ - intro - setup/github - setup/windows_version - setup/windows_virtualization - setup/windows_wsl - setup/windows_ubuntu - setup/windows_vscode - setup/windows_terminal - vscode_extensions - setup/cli_tools - setup/oh_my_zsh - windows_browser - direnv - setup/gh_cli - ubuntu_gcloud - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - setup/ssh_agent - conda_uninstall - ubuntu_python - virtualenv - pip - nbextensions - win_jupyter - python_checkup - insomnia - setup/windows_settings - win_vs_redistributable - gcp_setup - gcp_setup_wsl - gcp_setup_end - kitt - setup/windows_slack - setup/slack_settings - bonus -].freeze - -WINDOWS_KC = %w[ - keep_current - python_checkup -].freeze +#!/usr/bin/env ruby +# frozen_string_literal: true -LINUX = %w[ - intro - setup/github - setup/ubuntu_vscode - vscode_extensions - setup/cli_tools - setup/oh_my_zsh - direnv - setup/gh_cli - ubuntu_gcloud - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - setup/ssh_agent - conda_uninstall - ubuntu_python - virtualenv - pip - nbextensions - python_checkup - insomnia - gcp_setup - gcp_setup_linux - gcp_setup_end - kitt - setup/ubuntu_slack - setup/slack_settings - bonus -] +require 'yaml' +require_relative 'lib/builder' -LINUX_KC = %w[ - keep_current - python_checkup -] +build_specs = Dir['builds/*.yml'].map { |filename| -VM = %w[ - intro - setup/github - de_setup/ssh_key - de_setup/gcp_setup - de_setup/virtual_machine - de_setup/win_vscode - de_setup/vscode_remote_ssh - vscode_extensions - setup/cli_tools - setup/oh_my_zsh - direnv - setup/gh_cli - de_setup/ubuntu_gcloud - de_setup/gcp_setup_linux - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - de_setup/zsh_default_terminal - setup/ssh_agent - ubuntu_python - virtualenv - pip - nbextensions - python_checkup - kitt - setup/windows_slack - setup/slack_settings - bonus -] + data = YAML.load_file(filename) -LOCALES = ["", "es"] # english + spanish locales - -FILENAMES = { - "WINDOWS" => ["WINDOWS", WINDOWS], - "macOS" => ["macOS", MAC_OS], - "LINUX" => ["LINUX", LINUX], - "WINDOWS_keep_current" => ["WINDOWS", WINDOWS_KC], - "macOS_keep_current" => ["macOS", MAC_OS_KC], - "LINUX_keep_current" => ["LINUX", LINUX_KC], - "VM" => ["VM", VM] -} - -DELIMITERS = { - "WINDOWS" => ["\\$WINDOWS_START\n", "\\$WINDOWS_END\n"], - "macOS" => ["\\$MAC_START\n", "\\$MAC_END\n"], - "LINUX" => ["\\$LINUX_START\n", "\\$LINUX_END\n"], - "VM" => ["\\$LINUX_START\n", "\\$LINUX_END\n"] + BuildSpec.new( + name: File.basename(filename, '.yml'), + os: data['os'], + locales: data['locales'], + partials: data['partials'] + ) } -def load_partial(partial, locale) - match_setup = partial.match(/setup\/(?[0-9a-z_]+)/) - match_de_setup = partial.match(/de_setup\/(?[0-9a-z_]+)/) - if match_de_setup - partial = match_de_setup[:partial] - elsif match_setup - partial = match_setup[:partial] - end - partial = File.join(locale, partial) unless locale.empty? - file = File.join("_partials", "#{partial}.md") - if match_de_setup - content = URI.open(File.join("https://raw.githubusercontent.com/lewagon/data-engineering-setup/main", file)) - .read - # replace data-setup repo relative path by data-engineering-setup repo URL - image_paths = content.scan(/\!\[.*\]\((.*)\)/).flatten - image_paths.each { |ip| content.gsub!(ip, "https://github.com/lewagon/data-engineering-setup/blob/main/#{ip}")} - # alternative image format - image_paths = content.scan(/src="(images\/.*)"/).flatten - image_paths.each { |ip| content.gsub!(ip, "https://github.com/lewagon/data-engineering-setup/blob/main/#{ip}")} - elsif match_setup - content = URI.open(File.join("https://raw.githubusercontent.com/lewagon/setup/master", file)) - .read - # replace data-setup repo relative path by setup repo URL - image_paths = content.scan(/\!\[.*\]\((.*)\)/).flatten - image_paths.each { |ip| content.gsub!(ip, "https://github.com/lewagon/setup/blob/master/#{ip}")} - else - content = File.read(file, encoding: "utf-8") - end - return content -end - -# load partials -loaded = FILENAMES.map { |filename, (os_name, partials)| partials }.flatten.uniq -loaded = loaded.map { |partial| LOCALES.map { |locale| [partial, locale]} }.flatten(1) -loaded = loaded.map { |partial, locale| ["#{partial}.#{locale}", load_partial(partial, locale)] }.to_h +constants = YAML.load_file('constants/constants.yml').freeze +repos_cfg = YAML.load_file('constants/repos.yml').freeze -# write files -LOCALES.each do |locale| - FILENAMES.each do |filename, (os_name, partials)| - filename += ".#{locale}" unless locale.empty? - filename += ".md" - File.open(filename, "w:utf-8") do |f| - partials.each do |partial| - content = loaded["#{partial}.#{locale}"].clone - # remove the OS dependant blocks - removed_blocks = DELIMITERS.keys - [os_name] - removed_blocks = removed_blocks - ["LINUX"] if os_name == "VM" - removed_blocks = removed_blocks - ["VM"] if os_name == "LINUX" - removed_blocks.each do |block| - delimiter_start, delimiter_end = DELIMITERS[block] - pattern = "#{delimiter_start}(.|\n)*?(?", value) - end - f << content - f << "\n\n" - end - end - end -end +Builder.new(build_specs, constants, repos_cfg).run diff --git a/builds/LINUX.yml b/builds/LINUX.yml new file mode 100644 index 0000000..06ef97c --- /dev/null +++ b/builds/LINUX.yml @@ -0,0 +1,35 @@ + +os: linux +locales: [en] +partials: + - intro + - setup/github + - setup/ubuntu_vscode + - vscode_extensions + - setup/cli_tools + - setup/oh_my_zsh + - direnv + - setup/gh_cli + - ubuntu_gcloud + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - setup/ssh_agent + - conda_uninstall + - ubuntu_python + - virtualenv + - pip + - nbextensions + - python_checkup + - insomnia + - gcp_setup + - gcp_setup_linux + - gcp_setup_end + - kitt + - setup/ubuntu_slack + - setup/slack_settings + - bonus diff --git a/builds/LINUX_keep_current.yml b/builds/LINUX_keep_current.yml new file mode 100644 index 0000000..f69e9d9 --- /dev/null +++ b/builds/LINUX_keep_current.yml @@ -0,0 +1,6 @@ + +os: linux +locales: [en] +partials: + - keep_current + - python_checkup diff --git a/builds/VM.yml b/builds/VM.yml new file mode 100644 index 0000000..586cc4e --- /dev/null +++ b/builds/VM.yml @@ -0,0 +1,40 @@ + +os: linux +locales: [en] +partials: + - intro + - setup/github + - name: de_setup/ssh_key + vars: + key_name: da-bootcamp + - de_setup/gcp_setup + - de_setup/virtual_machine + - de_setup/win_vscode + - name: de_setup/vscode_remote_ssh + vars: + vm_hostname: da-bootcamp-vm + - vscode_extensions + - setup/cli_tools + - setup/oh_my_zsh + - direnv + - setup/gh_cli + - de_setup/ubuntu_gcloud + - de_setup/gcp_setup_linux + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - de_setup/zsh_default_terminal + - setup/ssh_agent + - ubuntu_python + - virtualenv + - pip + - nbextensions + - python_checkup + - kitt + - setup/windows_slack + - setup/slack_settings + - bonus diff --git a/builds/WINDOWS.yml b/builds/WINDOWS.yml new file mode 100644 index 0000000..a213bb4 --- /dev/null +++ b/builds/WINDOWS.yml @@ -0,0 +1,44 @@ + +os: windows +locales: [en] +partials: + - intro + - setup/github + - setup/windows_version + - setup/windows_virtualization + - setup/windows_wsl + - setup/windows_ubuntu + - setup/windows_vscode + - setup/windows_terminal + - vscode_extensions + - setup/cli_tools + - setup/oh_my_zsh + - windows_browser + - direnv + - setup/gh_cli + - ubuntu_gcloud + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - setup/ssh_agent + - conda_uninstall + - ubuntu_python + - virtualenv + - pip + - nbextensions + - win_jupyter + - python_checkup + - insomnia + - setup/windows_settings + - win_vs_redistributable + - gcp_setup + - gcp_setup_wsl + - gcp_setup_end + - kitt + - setup/windows_slack + - setup/slack_settings + - bonus diff --git a/builds/WINDOWS_keep_current.yml b/builds/WINDOWS_keep_current.yml new file mode 100644 index 0000000..e230908 --- /dev/null +++ b/builds/WINDOWS_keep_current.yml @@ -0,0 +1,6 @@ + +os: windows +locales: [en] +partials: + - keep_current + - python_checkup diff --git a/builds/macOS.yml b/builds/macOS.yml new file mode 100644 index 0000000..7b9c0a3 --- /dev/null +++ b/builds/macOS.yml @@ -0,0 +1,37 @@ + +os: macos +locales: [en] +partials: + - intro + - setup/github + - osx_silicon + - setup/macos_command_line_tools + - homebrew + - setup/macos_vscode + - vscode_extensions + - setup/oh_my_zsh + - direnv + - setup/gh_cli + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - conda_uninstall + - osx_python + - virtualenv + - pip + - nbextensions + - python_checkup + - insomnia + - gcp_cli_setup + - gcp_setup + - gcp_setup_mid + - gcp_setup_end + - kitt + - setup/macos_slack + - setup/slack_settings + - setup/macos_settings + - bonus diff --git a/builds/macOS_keep_current.yml b/builds/macOS_keep_current.yml new file mode 100644 index 0000000..7665829 --- /dev/null +++ b/builds/macOS_keep_current.yml @@ -0,0 +1,6 @@ + +os: macos +locales: [en] +partials: + - keep_current + - python_checkup diff --git a/constants/constants.yml b/constants/constants.yml new file mode 100644 index 0000000..50d9d24 --- /dev/null +++ b/constants/constants.yml @@ -0,0 +1,7 @@ + +PYTHON_VERSION: "3.12.9" +PYTHON_CHECKER_URL: "https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/python_checker.sh" +PIP_CHECKER_URL: "https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/pip_check.sh" +PIP_LOADER_URL: "https://raw.githubusercontent.com/lewagon/data-analytics-setup/master/checks/pip_check.py" +CODE_EDITOR: "VS Code" +CODE_EDITOR_CMD: "code" diff --git a/constants/repos.yml b/constants/repos.yml new file mode 100644 index 0000000..2fc6f3d --- /dev/null +++ b/constants/repos.yml @@ -0,0 +1,6 @@ + +branches: + setup: master + +aliases: + de_setup: data-engineering-setup diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000..6dbff8e --- /dev/null +++ b/doc/README.md @@ -0,0 +1,28 @@ + +# NOTE(ssaunier): This script needs https://github.com/lewagon/setup to be cloned as well + +## Build guides + +`bundle exec ruby build.rb` generates the setup guide markdown files at the repo root (e.g. `macOS.md`, `macOS.es.md`). + +Each file in `builds/` defines one guide: + +```yaml +os: macos +locales: [en, es] +partials: + - intro # local: _partials/intro.md / _partials/es/intro.md + - setup/github # remote: lewagon/setup _partials/github.md + - de_setup/direnv # remote alias: lewagon/data-engineering-setup _partials/direnv.md +``` + +Partials without a `/` are loaded from `_partials/` (English) or `_partials/{locale}/` (other locales). +Partials with a `/` are fetched from GitHub: `{repo}/_partials/{locale}/{name}.md`. Remote repo branches and aliases are configured in `constants/repos.yml`. + +Template variables available in all partials are defined in `constants/constants.yml`. + +CI runs the build on every push and commits the generated files if they changed. + +## Guide descriptions + +`VM`: student installs VS Code, creates a GCP VM, runs setup on the VM diff --git a/lib/build_spec.rb b/lib/build_spec.rb new file mode 100644 index 0000000..a86d164 --- /dev/null +++ b/lib/build_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require_relative 'localized_build' + +class BuildSpec + attr_reader :name, :os, :locales, :partials + + def initialize(name:, os:, locales:, partials:) + @name = name + @os = os + @locales = locales + @partials = partials + end + + def localized_builds(repos_cfg) + @locales.map { |locale| LocalizedBuild.new(self, locale, repos_cfg) } + end +end diff --git a/lib/builder.rb b/lib/builder.rb new file mode 100644 index 0000000..9a22437 --- /dev/null +++ b/lib/builder.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative 'build_spec' +require_relative 'partial_cache' +require_relative 'generator' + +class Builder + def initialize(build_specs, constants, repos_cfg) + @build_specs = build_specs + @constants = constants + @repos_cfg = repos_cfg + end + + def run + builds = @build_specs.flat_map { |spec| spec.localized_builds(@repos_cfg) } + cache = PartialCache.new(builds) + Generator.new(builds, cache, @constants).run + end +end diff --git a/lib/generator.rb b/lib/generator.rb new file mode 100644 index 0000000..55cfdca --- /dev/null +++ b/lib/generator.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'liquid' + +class Generator + def initialize(localized_builds, cache, constants) + @localized_builds = localized_builds + @cache = cache + @constants = constants + end + + def run + @localized_builds.each do |build| + File.open(build.output_filename, 'w:utf-8') do |f| + build.partials.each { |partial| f << render(partial, build) } + end + warn "built #{build.output_filename}" + end + end + + private + + def render(partial, build) + variables = @constants.merge(partial.vars).merge('os' => build.os, 'build_md' => build.output_filename) + "#{Liquid::Template.parse(@cache[partial.url].clone).render(variables)}\n\n" + end +end diff --git a/lib/localized_build.rb b/lib/localized_build.rb new file mode 100644 index 0000000..7bb8f9d --- /dev/null +++ b/lib/localized_build.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require_relative 'partial' + +class LocalizedBuild + attr_reader :os, :locale, :partials + + def initialize(spec, locale, repos_cfg) + @name = spec.name + @os = spec.os + @locale = locale + @partials = spec.partials.map { |entry| Partial.from(entry, locale, repos_cfg) } + end + + def output_filename + @locale == 'en' ? "#{@name}.md" : "#{@name}.#{@locale}.md" + end +end diff --git a/lib/partial.rb b/lib/partial.rb new file mode 100644 index 0000000..a7f3951 --- /dev/null +++ b/lib/partial.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative 'partial/remote' +require_relative 'partial/local' + +module Partial + REMOTE_REGEX = %r{\A(?[a-z][a-z0-9_-]*)/(?[a-z0-9_]+)\z} + + # entry is either a plain string or a hash: { 'name' => '...', 'vars' => { ... } } + def self.from(entry, locale, repos_cfg) + name = entry.is_a?(Hash) ? entry['name'] : entry + vars = entry.is_a?(Hash) ? entry.fetch('vars', {}) : {} + if (m = name.match(REMOTE_REGEX)) + Remote.new(m[:repo], locale, m[:name], vars, repos_cfg) + else + Local.new(locale, name, vars) + end + end +end diff --git a/lib/partial/local.rb b/lib/partial/local.rb new file mode 100644 index 0000000..92bb992 --- /dev/null +++ b/lib/partial/local.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Partial + class Local + attr_reader :url, :vars + + def initialize(locale, name, vars) + localized = "_partials/#{locale}/#{name}.md" + english = "_partials/#{name}.md" + @url = (locale != 'en' && File.exist?(localized)) ? localized : english + @vars = vars + end + + def content = File.read(@url, encoding: 'utf-8') + end +end diff --git a/lib/partial/remote.rb b/lib/partial/remote.rb new file mode 100644 index 0000000..01a0900 --- /dev/null +++ b/lib/partial/remote.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'open-uri' + +module Partial + class Remote + attr_reader :url, :vars + + def initialize(repo, locale, name, vars, repos_cfg) + repo = repos_cfg.dig('aliases', repo) || repo + branch = repos_cfg.dig('branches', repo) || 'main' + path = locale == 'en' ? name : "#{locale}/#{name}" + @base_url = "https://github.com/lewagon/#{repo}/blob/#{branch}" + @url = "https://raw.githubusercontent.com/lewagon/#{repo}/#{branch}/_partials/#{path}.md" + @vars = vars + end + + def content + text = URI.open(@url).read + # Rewrite relative image paths to absolute GitHub URLs so they render outside their source repo + text.scan(/\!\[.*\]\((.*)\)/).flatten + .reject { |ip| ip.start_with?('http') } + .each { |ip| text.gsub!(ip, "#{@base_url}/#{ip}") } + text.scan(/src="(images\/.*)"/).flatten + .each { |ip| text.gsub!(ip, "#{@base_url}/#{ip}") } + text + end + end +end diff --git a/lib/partial_cache.rb b/lib/partial_cache.rb new file mode 100644 index 0000000..e425148 --- /dev/null +++ b/lib/partial_cache.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class PartialCache + def initialize(localized_builds) + @cache = localized_builds + .flat_map(&:partials) + .uniq { |partial| partial.url } + .sort_by { |partial| partial.url } + .map { |partial| Thread.new { [partial.url, partial.content] } } + .map { |thread| thread.value } + .tap { |results| results.each { |url, _| warn "fetched #{url}" } } + .to_h + end + + def [](url) + @cache[url] + end +end diff --git a/macOS.md b/macOS.md index 0ff6141..29296fa 100644 --- a/macOS.md +++ b/macOS.md @@ -6,6 +6,7 @@ Please **read them carefully and execute all commands in the following order**. Let's start :rocket: + ## GitHub account Have you signed up to GitHub? If not, [do it right away](https://github.com/join). @@ -16,6 +17,7 @@ Have you signed up to GitHub? If not, [do it right away](https://github.com/join :point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub. + ## Apple Silicon Chips If you bought your computer after late 2020, chances are it has a new Apple silicon chip instead of an Intel processor: let's find out. @@ -51,6 +53,7 @@ In case you don't see this box, just continue. 🚨 Keep this in mind. You will need to remember later on in the setup whether your computer uses an Apple Silicon chip or is an Apple Intel version + ## A note about quitting apps on a Mac Clicking the little red cross in the top left corner of the application window on a Mac **does not really quit it**, it just closes an active window. To quit the application _for real_ either press `Cmd + Q` when the application is active, or navigate to `APP_NAME` -> `Quit` in the menu bar. @@ -75,6 +78,7 @@ If you receive the following message, you can just skip this step and go to next Otherwise, it will open a window asking you if you want to install some software: click on "Install" and wait. + ![Install xcode-select on macOS](https://github.com/lewagon/setup/blob/master/images/macos_xcode_select_install.png) :heavy_check_mark: If you see the message "The software was installed" then all good :+1: @@ -89,9 +93,10 @@ sudo softwareupdate --clear-catalog Once this is done, you can try to install again. + ## Homebrew -### 1. Install +### 1. Install: On Mac, you need to install [Homebrew](http://brew.sh/) which is a Package Manager. It will be used as soon as we need to install some software. @@ -125,7 +130,7 @@ brew tap homebrew/core If you already have Homebrew, it will tell you so, that's fine, go on. -### 2. Make sure you are on the latest version +### 2. Make sure you are on the latest version: ```bash brew update @@ -143,7 +148,7 @@ brew update
-### 3. Then install some useful software +### 3. Then install some useful software: Proceed running the following in the terminal (you can copy / paste all the lines at once). @@ -160,6 +165,7 @@ brew upgrade xz || brew install xz brew upgrade readline || brew install readline ``` + ## Visual Studio Code ### Installation @@ -182,6 +188,8 @@ code :x: Otherwise, please **contact a teacher** + + ## VS Code Extensions ### Installation @@ -210,6 +218,7 @@ Here is a list of the extensions you are installing: - [Jupyter](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) - [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite) + ## Oh-my-zsh Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/). @@ -230,15 +239,19 @@ At the end your terminal should look like this: :x: Otherwise, please **ask for a teacher** + ## direnv [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -251,7 +264,7 @@ We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol t First in order to **login**, copy-paste the following command in your terminal: -:warning: **DO NOT edit the `email`** +:warning: **DO NOT edit the `email`** — Even though `user:email` looks like a placeholder for your actual email address, it isn't — do not replace it. ```bash gh auth login -s 'user:email' -w --git-protocol ssh @@ -263,7 +276,9 @@ gh auth login -s 'user:email' -w --git-protocol ssh If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`. -- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`. +- `Enter a passphrase for your new SSH key (Optional)`: + - **FOR MOST PEOPLE:** Just press `Enter` to skip. You don't need a passphrase for the bootcamp and it would prompt you every time you use the key. There is a risk, however, that if someone steals your laptop, they could then push to GitHub. + - **IF SECURITY IS REALLY IMPORTANT TO YOU:** Enter a passphrase of your choice and press `Enter`. It's _really_ important that if you enter a passphrase, you write it down somewhere immediately and do not lose/forget it. You will need to enter this frequently. - `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`. @@ -286,10 +301,11 @@ To check that you are properly connected, type: gh auth status ``` -:heavy_check_mark: If you get `Logged in to github.com as `, then all good :+1: +:heavy_check_mark: If you get `Logged in to github.com as `, then all good :+1: :x: If not, **contact a teacher**. + ## Dotfiles Hackers love to refine and polish their shell and tools. We'll start with a great default configuration provided by [Le Wagon](http://github.com/lewagon/dotfiles), stored on GitHub. @@ -310,6 +326,7 @@ There seems to be a problem with the previous step (`gh auth`). There are three options, choose **one**: +
I did not attend the Web Dev or Data Science & AI or Data Analytics bootcamp at Le Wagon @@ -329,6 +346,7 @@ gh repo fork lewagon/dotfiles --clone
+
I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI or Data Analytics) but I have a new laptop @@ -343,6 +361,7 @@ mkdir -p ~/code/$GITHUB_USERNAME && cd $_ gh repo clone $GITHUB_USERNAME/dotfiles ``` + Open your terminal and go to your `dotfiles` project: ```bash @@ -395,13 +414,15 @@ git push origin master
+
- I already did the setup of a Le Wagon coding bootcamp (WebDev, Data Science & AI, or Data Analytics) on the same laptop before + I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI or Data Analytics) on the same laptop before This means that you already forked and cloned the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Analytics bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** + Open your terminal and go to your `dotfiles` project: ```bash @@ -454,6 +475,7 @@ git push origin master
+ ### Run the dotfiles installer It's time to run the `dotfiles` installer: @@ -479,6 +501,7 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh Please now **quit** all your opened terminal windows. + ## Installing Python (with [`pyenv`](https://github.com/pyenv/pyenv)) ### Uninstall `conda` @@ -491,8 +514,10 @@ Check if you have `conda` installed on your machine: conda list ``` + If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install pre-requisites** section. +
conda uninstall instructions @@ -509,13 +534,17 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + rm -rf ~/opt + ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line + - Save the file with `CMD` + `s` + - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` @@ -523,6 +552,7 @@ rm -rf ~/opt
+ ### Install pre-requisites Before installing Python, please check your `xz` version with: @@ -622,6 +652,7 @@ exec zsh To check if this worked, run `python --version`. If you see `3.12.9`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). + ## Python Virtual Environment Before we start installing relevant Python packages, we will isolate the setup for the Bootcamp into a **dedicated** virtual environment. We will use a `pyenv` plugin called [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). @@ -649,6 +680,7 @@ pyenv global lewagon Great! Anytime we'll install Python package, we'll do it in that environment. + ### Python packages Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. @@ -661,6 +693,7 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -683,6 +716,8 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/ma
+ + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -696,6 +731,7 @@ mkdir -p $LOCATION curl $SOURCE > $LOCATION/custom.css ``` + ## Python setup check ### Python and packages check @@ -756,6 +792,7 @@ You can close your web browser then terminate the jupyter server with `CTRL` + ` Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. + ## Insomnia > ℹ️ **Why?** Insomnia is one of the best-known API testing tools, and it will be useful in our Introduction to API course. @@ -766,6 +803,8 @@ Here you have it! A complete python virtual env with all the third-party package - Install Insomnia + + ## `gcloud` CLI Before Setting up our Google Cloud Platform account let's configure the `gcloud` CLI (A command line interface for Google Cloud Platform). Run the below and follow the terminal prompts to update your $PATH and enable shell command completion for the `.zshrc` file: @@ -887,7 +926,7 @@ Once this is done, select the standard (free) plan. No need to add the card to A You now have a virtual card which we will use for the GCP setup. -In the main view of the Revolut the app: +In the main view of the Revolut the app - Click on Ready to use - Click on the card @@ -924,10 +963,12 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP + ```bash gcloud auth login ``` + - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present @@ -1022,6 +1063,7 @@ An alternate way to navigate to the Service Accounts page is from the following: - The browser has now saved the service account json file 🔑 in your downloads directory (it is named according to your service account name, something like `le-wagon-data-123456789abc.json`). + - Store the service account json file somewhere you'll remember, for example: ``` bash @@ -1044,6 +1086,8 @@ code ~/.zshrc in the Terminal! 😄 + +
ℹ️ How to find the absolute path of a file? You can drag and drop the file in your terminal. @@ -1095,12 +1139,13 @@ gcloud projects get-iam-policy PROJECT_ID \ Troubleshooting - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` - - Make sure that billing is enabled for your Google Cloud Platform project https://cloud.google.com/billing/docs/how-to/modify-project + - Make sure that billing is enabled for your Google Cloud Platform project [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project)
🏁 You are done with the GCP setup! -## Kitt + + ## Kitt You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). @@ -1108,6 +1153,7 @@ Then you should receive an additional invitation from Slack, inviting you to the If you haven't, please contact your teaching team. + ## Slack [Slack](https://slack.com/) is a communication platform pretty popular in the tech industry. @@ -1118,6 +1164,7 @@ If you haven't, please contact your teaching team. :warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured. + ### Settings Launch the app and sign in to `lewagon-alumni` organization. @@ -1129,7 +1176,6 @@ Make sure you **upload a profile picture** :point_down: The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc. To ensure that everything is working fine for video calls, let's test your camera and microphone: - - Open the Slack app - Click your profile picture in the top right. - Select `Preferences` from the menu. @@ -1145,6 +1191,7 @@ To ensure that everything is working fine for video calls, let's test your camer You can also install Slack app on your phone and sign in `lewagon-alumni`! + ## macOS settings ### Security @@ -1185,22 +1232,18 @@ To pin an app to your dock, launch the app, right-click on the icon in the taskb ![How to pin an app to the taskbar in macOS](https://github.com/lewagon/setup/blob/master/images/macos_dock.png) -You should pin: - +You must pin: - Your terminal - Your file explorer - VS Code - Your Internet browser - Slack -## Setup completed! - -That's all you need for now! Some of the free trial periods on the tools we use are very short, so from now on, whenever we introduce a new tool or software, we will guide you through the sign-in and installation steps at the beginning of the day. -Ready to start? 🚀 - -## (Bonus) +## Bonus If you are done with your setup, please ask around if some classmates need some help with theirs (macOS, Linux, Windows). We will have our first lectures at 2pm and will talk about the Setup you just did + onboard you on Kitt. If you don't have a lot of experience with `git` and GitHub, please [(re-)watch this workshop](https://www.youtube.com/watch?v=Z9fIBT2NBGY) (`1.25` playback speed is fine). + + diff --git a/macOS_keep_current.md b/macOS_keep_current.md index 58502a6..75ca520 100644 --- a/macOS_keep_current.md +++ b/macOS_keep_current.md @@ -87,10 +87,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : + ``` bash brew update && brew upgrade pyenv ``` + Install the current python version : ```bash @@ -141,6 +143,7 @@ pyenv versions pip install -U pip ``` + If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -163,6 +166,7 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-analytics-setup/ma
+ ## GCP Make sure that the `gcloud` command is linked to the email address of your Google Cloud Platform account : @@ -249,6 +253,7 @@ Make sure that the file contains the correct : 👉 If this does not display anything or if the email inside of the file is not the one of your service account, go back to the setup + ## Python setup check ### Python and packages check @@ -308,3 +313,5 @@ It should output `3.12.9` followed by some more details. If not, check with a TA You can close your web browser then terminate the jupyter server with `CTRL` + `C`. Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. + +