diff --git a/LINUX.es.md b/LINUX.es.md index f215db64..04598215 100644 --- a/LINUX.es.md +++ b/LINUX.es.md @@ -1,10 +1,13 @@ -# Instrucciones para la configuración -Aquí abajo encontrarás las instrucciones para configurar tu computadora para [el curso de Data Science de Le Wagon](https://www.lewagon.com/data-science-course/full-time) +# Instrucciones de configuración -Por favor **léelas cuidadosamente y ejecuta todos los comandos en el siguiente orden**. Si tienes algún problema, no dudes en pedirle ayuda a una profesor :raising_hand: +A continuación encontrarás las instrucciones para configurar tu ordenador para el [bootcamp de Data Science & AI de Le Wagon](https://www.lewagon.com/data-science-course). -¡Comencemos! :rocket: +Por favor, **léelas detenidamente y ejecuta todos los comandos en el siguiente orden**. + +Esta configuración no es un ejercicio; su único propósito es preparar tu ordenador de forma estandarizada. No experimentes ni pidas ayuda a un LLM. Si te atascas, simplemente pide ayuda a un profesor :raising_hand: + +Empecemos :rocket: ## Cuenta GitHub @@ -90,7 +93,7 @@ Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento En **VS Code**: -1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS). +1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P`. 1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción. @@ -146,7 +149,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` Estos comandos te pedirán tu contraseña: escríbela. @@ -199,18 +202,6 @@ Cuando termines, tu terminal debería lucir así: :x: Si no, por favor **pídele ayuda a un profesor**. -## direnv - -[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. - - -``` bash -sudo apt-get update; sudo apt-get install direnv -echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc -``` - - - ## GitHub CLI CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando. @@ -265,196 +256,146 @@ gh auth status :x: De lo contrario, **contacta a un profesor**. -## CLI de Google Cloud - -Instala la CLI de `gcloud` para comunicar con [Google Cloud Platform](https://cloud.google.com/) a través de la terminal: -```bash -sudo apt-get update && sudo apt-get install ca-certificates gnupg curl -curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg -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 update && sudo apt-get install google-cloud-cli -``` -👉 [Documentación para la instalación](https://cloud.google.com/sdk/docs/install#deb) - - ## Dotfiles -Los hackers aman mejorar sus shells y sus herramientas. Comenzaremos con una configuración por defecto genial proporcionada por [Le Wagon](http://github.com/lewagon/dotfiles) y almacenada en GitHub. +Mejoremos la experiencia de tu máquina instalando los [dotfiles 🔗](https://github.com/lewagon/dotfiles) preconfigurados de Le Wagon. Son archivos de configuración para tu terminal, zsh, git y VS Code. + -### Verifica tu configuración de GitHub CLI +### Obtener tu nombre de usuario de GitHub -Primero, hagamos una verificación rápida. Abre tu terminal y ejecuta el comando siguiente: +Ejecuta el siguiente comando: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -Deberías ver tu usuario GitHub. Si no es así, **no hagas más nada** y pide ayuda. -Parece que hay un problema con el paso anterior (`gh auth`). - - -### Fork y/o clone los archivos de configuración +✔️ Deberías ver tu nombre de usuario de GitHub en la pantalla. -Hay tres opciones, escoge **una**: - - -
- - No he hecho el bootcamp de Web Development o Data Science & AI de Le Wagon - +❌ Si no es así, detente aquí y pide ayuda. Puede haber un problema con el paso anterior (`gh auth`). - Tu configuración es personal, así que necesitas tu propio repositorio para almacenarla. Primero tienes que hacer el fork del repositorio en tu cuenta GitHub. -Hacer un fork significa que crearás un nuevo repositorio en tu cuenta GitHub idéntico al original. Tendrás un nuevo repositorio en tu cuenta GitHub, `your_github_username/dotfiles`. El fork es necesario porque cada uno de ustedes necesitará poner información específica (e.g. tu nombre) en esos archivos. +### Crear un fork de los dotfiles -Ejecutemos este comando para hacer un **fork** del repositorio `lewagon/dotfiles` y clonarlo: - - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+Para personalizar esta configuración, tendrás que crear un **fork** del repositorio en tu propia cuenta de GitHub. +Crear un **fork** genera una copia del repositorio en tu cuenta (`your_github_username/dotfiles`), que luego podrás modificar con tus datos personales, como tu nombre.
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon pero tengo una nueva laptop - - -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento.Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** - -Es hora de clonarlo el repositorio en tu laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone lewagon/dotfiles -``` +Si ya hiciste otro bootcamp de Le Wagon (Desarrollo web, Desarrollo de software con IA, Análisis de datos, Ciencia de datos e IA), abre un ticket con un TA y abre esta sección para ver las instrucciones ❗ + +Es posible que tengas una versión antigua de los dotfiles de Le Wagon. Podrían ser incompatibles con la configuración actual. -Abre tu terminal y ve a tu proyecto `dotfiles`: -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` +**Junto con un TA**, haz una de las siguientes acciones: -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +
+Estoy usando la misma máquina (o una máquina nueva que ya tiene los dotfiles). -1. Commit la versión actual de tus dotfiles: +1. Ve a tu carpeta actual de dotfiles: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Trae los cambios del repositorio upstream: `git merge upstream/master` - -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +1. Comprueba las diferencias con la versión actual de los dotfiles de Le Wagon: + ```bash + git diff upstream/master + ``` -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración. -1. Si todo parece estar en orden, continúa. +
- ¿Demasiados conflictos? - - - Vamos a tomar la versión actual de `lewagon/dotfiles`. +Estoy usando una máquina nueva sin los dotfiles. - Primero aborta la merge: `git merge --abort`. +1. Ve a GitHub y encuentra tu repositorio de `dotfiles`. - Ejecuta `code .` +1. Comprueba cuántos commits por detrás y por delante está de `lewagon/dotfiles:master`. Puedes verlo justo encima de la lista de archivos. - En VS Code, 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. +1. Haz clic en los enlaces de commits por detrás y por delante, y desplázate hacia abajo para ver las diferencias. - Aún en VS Code, 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. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración.
-Es hora de guardar tus cambios y subirlos. +
+El paso anterior mostró diferencias importantes. -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` +Si estás de acuerdo con perder tus dotfiles actuales (recomendado): -
+Ten en cuenta que esto eliminará cualquier cambio personal que hayas hecho en la configuración de tu shell, como cargar utilidades adicionales o cambiar su apariencia. Si no recuerdas haber hecho cambios, no debería haber ningún problema. +1. Elimina tu repositorio actual de dotfiles en GitHub. +1. Elimina el repositorio local: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continúa con la configuración.
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon en la misma laptop - +Si no quieres perder tus dotfiles actuales, te recomendamos trabajar con ramas. Haz clic para abrir. -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento. Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** +En tu **portátil**, o donde tengas una copia **local** de **tu versión actual de los dotfiles**. +1. Haz commit de tu versión actual de los dotfiles: -Abre tu terminal y ve a tu proyecto `dotfiles`: + ```bash + git add . + git status # Comprueba qué se incluirá en el commit + git commit -m "Version prior to new setup" + ``` -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` - -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +1. Crea una rama de tu configuración actual de dotfiles y súbela a GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Commit la versión actual de tus dotfiles: - ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" - ``` +1. Vuelve a `master`: `git checkout master`. -1. Trae los cambios del repositorio upstream: `git merge upstream/master` +1. En tu `master` local, ejecuta `git pull upstream master`. -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +1. Comprueba que no estés en estado `MERGING`. Si lo estás, resuelve los conflictos. + + Es importante que aceptes los cambios entrantes en los archivos `.zshrc`, `.zprofile` y `settings.json`, especialmente todo lo relacionado con `pyenv` y los entornos de Python. -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. + Si hay demasiados conflictos, usa tu editor de código para reemplazar el contenido de los archivos en conflicto por el de los [dotfiles de Le Wagon](https://www.github.com/lewagon/dotfiles). -1. Si todo parece estar en orden, continúa. + Haz commit de la resolución de conflictos: `git commit --no-edit` -
- ¿Demasiados conflictos? - +1. Sube tus cambios a GitHub: `git push origin master`. - Vamos a tomar la versión actual de `lewagon/dotfiles`. +1. Continúa con la configuración. - Primero aborta la merge: `git merge --abort`. - - Ejecuta `code .` - - En VS Code, 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 VS Code, 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. +
-Es hora de guardar tus cambios y subirlos. +
+ +Es hora de crear un fork del repositorio y clonarlo en tu ordenador: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - - +Si aparece la pregunta _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, escribe `yes` y pulsa `Enter`. -### Ejecuta el instalador de dotfiles +### Instalar los dotfiles -Ejecuta el instalador de `dotfiles`. +Ejecuta el instalador de `dotfiles` con: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno de ellos en el próximo paso: +Comprueba los correos electrónicos registrados en tu cuenta de GitHub. Tendrás que elegir uno en el siguiente paso: ```bash gh api user/emails | jq -r '.[].email' @@ -466,177 +407,109 @@ Ejecuta el instalador de git: cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` -:point_up: Esto te **guiará** con tu nombre (`FirstName LastName`) y con tu email. -:warning: Cuidado, **debes** poner uno de los emails de la lista de arriba que te suministra el comando `gh api ...` usado anteriormente. Si haces eso, Kitt no podrá hacerle seguimiento a tu progreso. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir. - -Ahora **cierra** todas las ventanas de tu terminal que tengas abiertas por favor. - +:point_up: Se te pedirá tu nombre (`FirstName LastName`) y tu correo electrónico. -## Desahilitación de la solicitud de SSH passphrase +:warning: **Debes** introducir uno de los correos que aparecen arriba, obtenidos con el comando `gh api ...`. Si no lo haces, Kitt no podrá realizar un seguimiento de tu progreso. -No vas a querer que te pidan tu passphrase cada vez que te comuniques con un repositorio remoto. Por eso debes agregarle plugin `ssh-agent` a `oh my zsh`: +💡 Selecciona la dirección `...@users.noreply.github.com` si no quieres que tu correo aparezca en repositorios públicos a los que contribuyas. -Primero abre el archivo `.zshrc`: -```bash -code ~/.zshrc -``` +## direnv -Luego: -- Identifica la línea que comienza por `plugins=` -- Agrega `ssh-agent` al final de la lista de plugins +[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. -La lista debería verse de la siguiente manera: -```bash -plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent) +``` bash +sudo apt-get update; sudo apt-get install direnv +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -:heavy_check_mark: Guarda el archivo `.zshrc` con `Ctrl` + `S` y cierra tu editor de texto. - -## Instalando Python (con [`pyenv`](https://github.com/pyenv/pyenv)) -### Desinstalar `conda` +## Instalar Python y sus dependencias -Como estamos utilizando `pyenv` para instalar y gestionar la versión de Python, necesitamos desinstalar [`conda`](https://docs.conda.io/projects/conda/en/latest/), otro gestor de paquetes que podrías tener en tu computadora si previamente instalaste [Anaconda](https://www.anaconda.com/). De esta forma, evitaremos problemas con Python más adelante. +Tu sistema operativo - macOS, o Ubuntu (nativo, o dentro de WSL) - viene con un "Python del sistema". Esa es una versión de Python de la que depende tu sistema. No vamos a tocar esa. Vamos a hacer una configuración profesional de Python en la que no estropees tu "Python del sistema" y en la que podrás cambiar la versión que quieras usar para cada proyecto en el que trabajes. -Chequea si tienes `conda` instalado en tu computadora: - -```bash -conda list -``` +Para gestionar diferentes versiones de Python y entornos virtuales (descubrirás qué significa eso durante la clase de configuración), usaremos la herramienta de última generación [`uv` creada por Astral](https://docs.astral.sh/uv/). -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**. +### Instalar `uv` -
- Instrucciones de desinstalación conda +Primero, instalaremos `uv`: -- Instala el paquete Anaconda-Clean desde tu terminal y comienza la limpieza -```bash -conda install anaconda-clean -anaconda-clean --yes -``` -- Remueve todos los directorios de Anaconda ```bash -rm -rf ~/anaconda2 -rm -rf ~/anaconda3 -rm -rf ~/.anaconda_backup - +curl -LsSf https://astral.sh/uv/install.sh | sh ``` -- 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 - - - Guarda el archivo con `CTRL` + `s` - -- Reinicia la terminal con `exec zsh` -- Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - - Abre el archivo con `code ~/.zshrc` - - Remueve las líneas de código desde `>>> conda initialize >>>` hasta `<<< conda initialize <<<` -
- - -### Instala `pyenv` -Ubuntu viene con una versión vieja de Python que no queremos usar. Tal vez ya hayas instalado Anaconda u otro programa para utilizar Python y paquetes de Ciencia de Datos. Si es así, no pasa nada ya que haremos una configuración profesional de Python que te permitirá cambiar de versión cuando quieras al escribir `python` en la terminal. - -Primero instala `pyenv` con el siguiente comando en la Terminal: +A continuación, reinicia tu shell ejecutando esto: ```bash -git clone https://github.com/pyenv/pyenv.git ~/.pyenv exec zsh ``` -Instala algunas [dependencias](https://github.com/pyenv/pyenv/wiki/common-build-problems#prerequisites) necesarias para crear Python desde `pyenv`: +### Crear un entorno virtual + +A continuación, crearemos un entorno virtual (un entorno aislado con Python y las dependencias del bootcamp): ```bash -sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ -libbz2-dev libreadline-dev sqlite3 libsqlite3-dev wget curl llvm \ -libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ -python3-dev +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 ``` -### Instala Python - -Instala la [última versión estable de Python](https://www.python.org/doc/versions/) que sea aceptada en el currículum de Le Wagon: +Ahora que hemos creado este nuevo entorno virtual, reiniciemos nuestro shell para que lo detecte (esto funciona gracias a los `lewagon/dotfiles` que instalamos antes): ```bash -pyenv install 3.12.9 +exec zsh ``` -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! - -OK. Cuando este comando termine de ejecutarse, le diremos al sistema que use esta versión de Python **por defecto**. Esto se hace con: +Comprobemos que todo ha ido bien. Ejecuta esto: ```bash -pyenv global 3.12.9 -exec zsh +which python3 ``` -Para verificar que esto haya funcionado, ejecuta `python --version`. Si ves `3.12.9`, ¡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). +Debería devolver esto: -## Entorno Virtual de Python +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 +``` -Antes de instalar paquetes de Python, aislaremos la configuración del Bootcamp en un entorno virtual **dedicado**. Usaremos un plugin `pyenv` llamado [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). -### Instala un virtualenv +Si no lo hace, ¡consulta con un TA! No continúes con el siguiente paso hasta que hayas resuelto esto. -Primero instala este plugin: -```bash -git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv -exec zsh -``` +### Instalar dependencias -Crea el entorno virtual que usaremos durante todo el bootcamp: +Python es genial para datos, porque la comunidad ha desarrollado una enorme cantidad de paquetes que podemos reutilizar. -```bash -pyenv virtualenv 3.12.9 lewagon -``` +Instalemos los más comunes: -Define el entorno virtual con lo siguiente: -```bash -pyenv global lewagon +``` bash +uv pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -¡Genial! Ahora cada vez que queramos instalar un paquete Python, lo haremos en ese entorno. -### Paquetes de Python +## Configuración de Jupyter Notebook -Ahora que tenemos el ambiente virtual de `lewagon` adecuado, es hora de instalarle algunos paquetes. +Dependiendo de tu sistema, necesitamos hacer algunos cambios pequeños en tu configuración de Jupyter. -Primero, actualiza `pip`, la herramienta para instalar Paquetes Python desde [pypi.org](https://pypi.org). Ejecuta lo siguiente en la última terminal donde esté activado el virtualenv de `lewagon`: +Ejecuta esto: ```bash -pip install --upgrade pip +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` -Ahora instala algunos paquetes para las primeras semanas del programa: - - -``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt -``` - - +
+Si tienes curiosidad sobre lo que sucede aquí, haz clic aquí. -## Mejora Jupyter Notebook +Este script añade una configuración para mejorar la visualización de los [elementos `details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. -Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. +Si estás usando Windows WSL, también soluciona otros problemas. -Ejecuta las siguientes líneas para crear una hoja de estilos `custom.css` en tu directorio de configuración de Jupyter: -```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css -``` +
## Chequeo de la configuración de Python @@ -654,18 +527,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -691,15 +552,18 @@ import sys; sys.version Debería mostrar `3.12.9` 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`. - -¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. +En otra celda, ejecuta: +```python +import pandas as pd +pd.__version___ +``` +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. -## DBeaver +Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. -DDescarga e instala [DBeaver](https://dbeaver.io/), una herramienta poderosa, gratuita y de código abierto para conectar con cualquier base de datos, explorar su esquema e incluso **hacer consultas SQL**. +¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. ## Docker 🐋 @@ -741,60 +605,70 @@ Debería aparecer el siguiente mensaje: ## Configuración de Google Cloud Platform -[GCP](https://cloud.google.com/) es una solución en la nube que usarás para colocar tus productos basados en Machine Learning en producción. +[Google Cloud](https://cloud.google.com/) es una solución en la nube que utilizarás para desplegar tus productos basados en Machine Learning en producción. + +🚨 Si eres estudiante del **Part-Time Bootcamp**, ¡OMITE ESTA SECCIÓN POR AHORA! **Google Cloud** ofrece 300 $ de crédito gratuito durante 3 meses. No querrás activar tu cuenta de Google Cloud demasiado pronto 🙅‍♂️ + -🚨 Si estás en el grupo de estudiantes del **Bootcamp de Medio Tiempo**, ¡IGNORA ESTA SECCIÓN POR AHORA! **GCP** ofrece $300 en créditos durante 3 meses, así que no es buena idea activar tu cuenta GCP demasiado pronto 🙅‍♂️ -### Preparación del Proyecto +### Configuración del proyecto - Ve a [Google Cloud](https://console.cloud.google.com/) y crea una cuenta si aún no tienes una -- En la consola de Cloud, en la lista de proyectos, selecciona o crea un proyecto Cloud +- En Cloud Console, en la lista de proyectos, selecciona o crea un proyecto de Cloud + +⚠️ **Importante:** Al crear un proyecto nuevo, verás un campo **Organization**. Déjalo como **"No organization"**. No selecciones ni crees una organización. Elegir una organización aplica restricciones que pueden impedirte utilizar los servicios de Google Cloud durante el bootcamp. ![](images/gcp-create-project.png) -- Asígnale un nombre como `Wagon Bootcamp` por ejemplo -- ❗ Comprueba que el campo _Location_ esté establecido en _No organization_ ❗ -- Verás que se creará un `ID` automáticamente para el proyecto e. g. `wagon-bootcamp-123456` + +- Asígnale un nombre, por ejemplo, `Wagon Bootcamp` +- Observa el `ID` que se crea automáticamente para el proyecto, por ejemplo, `wagon-bootcamp-123456` ![](images/gcp_project.png) +ℹ️ Anota el **Project ID** (por ejemplo, `wagon-bootcamp-123456`), que **no** es lo mismo que el nombre del proyecto que elegiste (por ejemplo, `Wagon Bootcamp`). Necesitarás el ID más adelante al ejecutar comandos en la terminal, pero no te preocupes: siempre puedes encontrarlo en Google Cloud. + ### Idioma de la cuenta -Abre las preferencias en tu cuenta GCP para facilitar el seguimiento de las instrucciones durante el bootcamp: +Para facilitar el seguimiento de las instrucciones durante el bootcamp, abre las preferencias de tu cuenta de Google Cloud: -https://myaccount.google.com/language +[https://myaccount.google.com/language](https://myaccount.google.com/language) + +Si el *idioma preferido* no es: -Si el *idioma de preferencia* no es: - **English** - **United States** -Cámbialo a inglés: -- Haz clic en el logo edición (es una lapicera) +Entonces cambia el idioma a inglés: + +- Haz clic en el icono del lápiz de edición - Selecciona **English** - Selecciona **United States** - Haz clic en **Select** ### Cuenta de facturación -Ahora conecta tu cuenta con tu tarjeta de crédito. Este paso es obligatorio para poder usar los servicios que suministra GCP. No te preocupes, podrás utilizar la mayoría de los servicios de GCP por medio de créditos gratuitos durante el bootcamp. +Ahora vincularás tu cuenta a tu tarjeta de crédito. Este paso es obligatorio; de lo contrario, no podrás utilizar los servicios proporcionados por Google Cloud. No te preocupes: podrás utilizar la mayoría de los servicios de Google Cloud mediante créditos gratuitos durante el bootcamp. + +⚠️ En algunos casos, Google puede hacer un cargo en tu tarjeta (de unos 10 €) para verificar que es válida. Desafortunadamente, no se reembolsará una vez aprobada, pero se añadirá como crédito en Google Cloud que podrás utilizar cuando hayas usado o hayan caducado tus créditos gratuitos. ![](images/gcp-billing.png) - Haz clic en **Billing** - Haz clic en **MANAGE BILLING ACCOUNTS** - Haz clic en **ADD BILLING ACCOUNT** -- Asígnale un nombre a tu cuenta de facturación, e. g. `My Billing Account` -- Haz clic en "I have read..." y acepta los términos de uso +- Ponle un nombre a tu cuenta de facturación, por ejemplo, `My Billing Account` +- Haz clic en "I have read..." y acepta las condiciones del servicio - Haz clic en **CONTINUE** -- Selecciona tu tipo de cuenta: `Individual` -- Agrega tu nombre y dirección +- Selecciona el tipo de cuenta: `Individual` +- Introduce tu nombre y dirección -Verás que tienes créditos gratuitos con un valor de "$300 a utilizar en los próximos 90 días". +Deberías ver que tienes un crédito gratuito de "$300 credits over the next 90 days". -- Haz clic en los detalles de la tarjeta -- Agrega la información de tu tarjeta de crédito -- Haz clic en **START MY FREE TRIAL**. Esto significa comenzar mi período de prueba. +- Haz clic en los datos de la tarjeta +- Introduce los datos de tu tarjeta de crédito +- Haz clic en **START MY FREE TRIAL** -Cuando termines, verifica que la cuenta de facturación esté conectada con tu proyecto GCP. +Una vez hecho esto, verifica que tu cuenta de facturación esté vinculada a tu proyecto de Google Cloud. - Selecciona tu proyecto - Ve a **Billing** @@ -802,204 +676,139 @@ Cuando termines, verifica que la cuenta de facturación esté conectada con tu p - Selecciona `My Billing Account` - Haz clic en **SET ACCOUNT** -Ahora deberías ver lo siguiente: +Ahora deberías ver: -``` +```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. ``` -Esto significa Estado de período de prueba: crédito de $300 y 91 días para usarlo - con la full account, tendrás acceso ilimitado a todo lo que ofrece Google Cloud Platform. -
👉 Si no tienes una tarjeta de crédito 👈 +Si no tienes una tarjeta de crédito, una alternativa es crear una cuenta de **Revolut**. +Revolut es una aplicación financiera que te permite crear una tarjeta de crédito virtual vinculada a tu cuenta de facturación del teléfono móvil. -Si no tienes una tarjeta de crédito, puedes abrir una cuenta en **Revolut**. -Revolut es una aplicación que funciona como un banco y que te permitirá crear una tarjeta de crédito virtual conectada a la dirección de facturación de tu smartphone. +Omite este paso si tienes una tarjeta de crédito y la utilizas para la configuración. -Ignora este paso si ya tienes una tarjeta de crédito. Simplemente úsala para hacer la configuración. +Descarga la aplicación Revolut o visita [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la aplicación (introduce tu número de teléfono móvil y haz clic en Get Started). -Descarga la app Revolut o ve a [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la app (introduce tu número de teléfono móvil y haz clic en Get Started). +- Abre la aplicación Revolut +- Introduce tu número de teléfono móvil +- Introduce el código de verificación recibido por SMS +- La aplicación te pedirá tu país, dirección, nombre y apellidos, fecha de nacimiento y dirección de correo electrónico +- La aplicación también te pedirá un selfie y tu profesión +- La aplicación requerirá una foto de tu documento de identidad o pasaporte -- Abre la app Revolut -- Agrega tu número de teléfono móvil -- Agrega el código de verificación que recibiste por SMS -- La app te preguntará por tu país, dirección, primer y segundo nombre, fecha de nacimiento y el email -- La app también te pedirá tu profesión y una selfie -- La app te pedirá una foto de tu documento nacional de identidad o pasaporte +Una vez hecho esto, selecciona el plan estándar (gratuito). No es necesario añadir la tarjeta a Apple Pay, solicitar el envío de una tarjeta física ni añadir dinero. -Cuando termines, selecciona el plan estándar (gratuito). No tienes que agregar la tarjeta a Apple pay, pedir que te envíen una tarjeta a tu domicilio ni tampoco agregar dinero a la cuenta. +Ahora tienes una tarjeta virtual que utilizaremos para configurar Google Cloud. -Ahora tienes una tarjeta virtual que podrás usar para hacer la configuración de GCP. +En la vista principal de la aplicación Revolut -En la vista principal de la app Revolut - Haz clic en Ready to use -- Haz clic en the card +- Haz clic en la tarjeta - Haz clic en Show card details -- Toma nota de la información de la tarjeta de crédito virtual y úsala para completar la configuración de GCP +- Anota los datos de la tarjeta de crédito virtual y utilízalos para continuar con la configuración de Google Cloud
- 👉 Si recibes un email de Google diciendo "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 + 👉 Si recibes un correo de Google que dice "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 - -Esto puede pasar justo después de haber creado la cuenta en Revolut. +Esto puede ocurrir especialmente si acabas de configurar una cuenta de Revolut. - Haz clic en PROCEED TO VERIFICATION -- Te pedirán que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, nada más) -- Si ya has usado **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides quitar la fecha de vencimiento de la captura) -- Explica que estás haciendo el bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta en Revolut para poder configurar GCP para el bootcamp con una tarjeta de crédito virtual +- Se te pedirá que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, sin ninguna otra información) +- Si utilizaste **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides eliminar la fecha de caducidad de la captura) +- Explica que estás asistiendo al bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta de Revolut para configurar Google Cloud para el bootcamp mediante una tarjeta de crédito virtual -Es posible que te validen la cuenta pero también es posible que te pidan más información en los próximos 30 minutos. +Puedes recibir una validación o solicitudes de más información en un plazo de 30 minutos. -Cuando la cuenta sea validada recibirás un email diciendo lo siguiente: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". Esto significa que tu cuenta Google Cloud Platform ha sido restablecida +Una vez completada la verificación, deberías recibir un correo que indique: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.".
-### Habilitación de servicios de GCP - -- Asegúrate de que la facturación está habilitada para tu proyecto Google Cloud - -ℹ️ Tienes un **crédito de $300** para usar con recursos de Google Cloud. Esto será más que suficiente para el bootcamp. +### Activación de los servicios de Google Cloud -- [Habilita las APIs BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Esto puede tomar varios minutos) +- Asegúrate de que la facturación esté activada para tu proyecto de Google Cloud -### Configuración de Cloud sdk - -- Autentica el CLI de `gcloud` con la cuenta que usaste para GCP -```bash -gcloud auth login -``` -- Inicia sesión en tu cuenta Google en la nueva pestaña que se abrió en tu navegador -- Lista la cuenta que tienes activa y verifica que el email que usaste para GCP está ahí -```bash -gcloud auth list -``` -- Define tu proyecto actual (reemplaza `PROJECT_ID` con el `ID` de tu proyecto e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- Lista la cuenta que tienes activa y tu proyecto actual y verifica que tu proyecto está ahí -```bash -gcloud config list -``` - -### Crea una llave 🔑 de cuenta de servicio - -Como ya creaste una cuenta `GCP account` y un `project` (identificado por su `PROJECT_ID`), vamos a configurar las acciones (llamadas API calls) que quieres que tu código ejecute. - -
- 🤔 ¿Por qué necesitamos una clave de cuenta de servicio? +ℹ️ Tienes un **crédito de 300 $** para utilizar en recursos de Google Cloud, más que suficiente para el bootcamp. +- [Activa las API de BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Este paso puede tardar unos minutos) - Creaste una `cuenta GCP` conectada a una tarjeta de crédito. Te facturarán de acuerdo al uso que les des a los recursos de **Google Cloud Platform**. El cargo se hará si utilizas algo después de que el período de prueba gratuito se haya terminado o si te excedes del límite de consumo que te permite dicho período. +¡Eso es todo para la configuración en el navegador! La configuración de la terminal aparece más adelante en esta guía. - En tu `cuenta GCP` has creado un solo `proyecto GCP` identificado por su `PROJECT_ID`. Los `proyectos GCP` te permiten organizar y monitorear la manera en que consumes los recursos **GCP** de forma más precisa. En este bootcamp solo crearemos un solo proyecto. - Ahora necesitamos una manera de saber qué recursos nuestro código podrá consumir dentro de un `GCP project`. Nuestro código consume recursos GCP por medio de llamadas API. - - Ya que las llamadas API no son gratuitas, es importante definir cuidadosamente cómo nuestro código las utilizará. Sin embargo, durante el bootcamp no habrá restricciones. Le permitiremos a nuestro código que utilice todas las API **GCP** sin restricciones. - - Así como pueden haber varios proyectos asociados a una cuenta GCP, un proyecto puede estar compuesto de muchos servicios (cualquier paquete de código, sin importar su formato, que necesite utilizar llamadas a la API de GCP para cumplir con su propósito). - - GCP exige que los servicios de los proyectos que usen llamadas API se registren en la plataforma y que se configuren sus credenciales por medio del acceso concedido a una `service account`. - - Por ahora solo tendremos que usar un solo servicio y crearemos la `service account` correspondiente. -
- -Ya que la [service account](https://cloud.google.com/iam/docs/service-accounts) es lo que identifica tu aplicación (y por ende tu cuenta de facturación GCP y, en última instancia, tu tarjeta de crédito), lo mejor es ser cuidadoso en los próximos pasos. - -⚠️ **No compartas la 🔑 del archivo json de tu cuenta de servicio** ⚠️ No la guardes en tu escritorio ni en tu código base de git (incluso si tu repositorio git es privado). Que no se te olvide en un lugar como la máquina de café y, por supuesto, no la envíes en un tweet. - -- Ve a la [página de las cuentas de servicio](https://console.cloud.google.com/apis/credentials/serviceaccountkey) -- Selecciona tu proyecto en la lista de proyectos recientes si te piden que -- Crees una cuenta de servicio: - - Haz clic en **CREATE SERVICE ACCOUNT** que significa crear une cuenta de servicio: - - Define un `Service account name` para esa cuenta. Esto significa Nombre de cuenta de servicio - - Haz clic en **CREATE AND CONTINUE** que significa crear y continuar - - Haz clic en **Select a role** que significa selecciona un rol. Escoge `Quick access/Basic` luego **Owner**. Esto otorga acceso total a todos los recursos - - Haz clic en **CONTINUE** - - Haz clic en **DONE** -- Descarga la 🔑 del archivo json de la cuenta de servicio: - - Haz clic en la cuenta de servicio recién creada - - Haz clic en **KEYS** - - Haz clic en **ADD KEY** y luego en **Create new key** - - Selecciona **JSON** y haz clic en **CREATE** - -![](images/gcp_create_key.png) +## CLI de Google Cloud -El navegador acaba de guardar la 🔑 del archivo json de la cuenta de servicio en tu carpeta de descargas (el nombre se le asigna según el nombre de la cuenta de servicio. Es algo como `le-wagon-data-123456789abc.json`) +Instala la CLI de `gcloud` para comunicar con [Google Cloud Platform](https://cloud.google.com/) a través de la terminal: +```bash +sudo apt-get update && sudo apt-get install ca-certificates gnupg curl +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg +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 update && sudo apt-get install google-cloud-cli +``` +👉 [Documentación para la instalación](https://cloud.google.com/sdk/docs/install#deb) -- Guarda el archivo json de la cuenta de servicio en un lugar que recuerdes. Por ejemplo: +### Configurar Cloud SDK -``` bash -/home/LINUX_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` +- Autentica la CLI de `gcloud` con la cuenta de Google que utilizaste para GCP -- Guarda la **ruta absoluta** al archivo `JSON` como una variable de entorno: + + ```bash + gcloud auth login + ``` + -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.aliases -``` +- Inicia sesión en tu cuenta de Google en la nueva pestaña que se abrió en tu navegador web +- Muestra tu cuenta activa y comprueba que aparece la dirección de correo electrónico que utilizaste para GCP + ```bash + gcloud auth list + ``` -
- ℹ️ ¿Cómo encontrar la ruta absoluta de un archivo? - Puedes arrastrar el archivo a tu terminal. -
+- Establece tu proyecto actual (reemplaza `PROJECT_ID` por el `ID` de tu proyecto, por ejemplo, `wagon-bootcamp-123456`) -**Reinicia** tu terminal y ejecuta lo siguiente: + ```bash + gcloud config set project PROJECT_ID + ``` -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` +- Muestra tu cuenta activa y tu proyecto actual, y comprueba que aparece tu proyecto -Deberías obtener la siguiente información: + ```bash + gcloud config list + ``` -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` +- Ahora vamos a configurar las credenciales predeterminadas de la aplicación para que tu código Python pueda acceder a GCP: -Ahora verifica si la ruta al archivo json de tu cuenta de servicio es el correcto: + ```bash + gcloud auth application-default login + ``` -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` + Esto abrirá una ventana del navegador. Inicia sesión con la misma cuenta de Google que utilizaste para crear tu proyecto de GCP. Tus credenciales se guardarán automáticamente. -👉 Este comando debería mostrar el contenido del archivo json de tu cuenta de servicio. Si no es el caso, pídele ayuda a un TA 🙏 +- Verifiquemos que tus credenciales predeterminadas de la aplicación funcionan: -Tu código y utilidades ahora pueden acceder a los recursos de tu cuenta GCP. + ```bash + gcloud auth application-default print-access-token + ``` -Continuemos con los últimos pasos de la configuración... + Deberías ver una cadena de token larga. Si aparece un error, vuelve a ejecutar `gcloud auth application-default login`. -- Lista las cuentas de servicio asociadas a tu cuenta activa y a tu proyecto actual -```bash -gcloud iam service-accounts list -``` -- Recupera el email de la cuenta de servicio e. g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- Lista los roles de la cuenta de servicio desde la cli (reemplaza el PROJECT_ID y el SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- Ahora deberías ver que tu cuenta de servicio tiene el rol de `roles/owner` +
+ Solución de problemas -
- Resolución de problemas + - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` + - Asegúrate de que la facturación esté habilitada para tu proyecto de Google Cloud Platform [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project) +
-- `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.`. Esto significa que el proyecto a facturar está asociado a una cuenta de facturación que no está habilitada - - Asegúrate de habilitar la facturación para tu proyecto https://cloud.google.com/billing/docs/how-to/modify-project -
+🏁 ¡Has terminado la configuración de GCP! -🏁 Listo. ¡Has terminado la configuración de GCP! - ## Kitt +## Kitt Deberías haber recibido un correo electrónico de Le Wagon invitándote a registrarte en [Kitt](https://kitt.lewagon.com) (nuestra plataforma de aprendizaje). diff --git a/LINUX.md b/LINUX.md index 0f38a7b8..fb6e11f4 100644 --- a/LINUX.md +++ b/LINUX.md @@ -1,9 +1,11 @@ # Setup instructions -You will find below the instructions to set up you computer for [Le Wagon Data Science course](https://www.lewagon.com/data-science-course/full-time) +Below are the instructions for setting up your computer for the [Le Wagon Data Science & AI bootcamp](https://www.lewagon.com/data-science-course). -Please **read them carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand: +Please **read them carefully and execute all commands in the following order**. + +This setup is not an exercise; its sole purpose is to prepare your machine in a standardised way. Do not experiment or ask an LLM for help. If you get stuck, simply ask a teacher for help :raising_hand: Let's start :rocket: @@ -106,7 +108,7 @@ For the start of the bootcamp, we’ll disable these features. At the right poin In **VS Code**: -1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS). +1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P`. 1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option. @@ -162,7 +164,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh tree +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` These commands will ask for your password: type it in. @@ -224,18 +226,6 @@ 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). @@ -290,193 +280,146 @@ 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 -sudo apt-get update && sudo apt-get install ca-certificates gnupg curl -curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg -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 update && sudo apt-get install google-cloud-cli -``` -👉 [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. +Let's enhance the experience of your machine by installing Le Wagon's pre-configured [dotfiles 🔗](https://github.com/lewagon/dotfiles). These are configuration files for your terminal, zsh, git, and VS Code. -### Check your GitHub CLI configuration -First, let's do a quick check. Open your terminal and run the following command: +### Get your GitHub username + +Run the following command: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -You should see your GitHub username printed. If it's not the case, **stop here** and ask for help. -There seems to be a problem with the previous step (`gh auth`). - -### Fork and/or clone dotfiles +✔️ You should see your Github username printed. -There are three options, choose **one**: +❌ If not, stop here and ask for help. There may be a problem with the previous step (`gh auth`). -
- - I did not attend the Web Dev or Data Science & AI bootcamp at Le Wagon - - - As your configuration is personal, you need your own repository storing it, so you'll need to fork it to your GitHub account. +### Forking the dotfiles -Forking means that it will create a new repo in your GitHub account, identical to the original one. You'll have a new repository on your GitHub account, `your_github_username/dotfiles`. We need to fork because each of you will need to put specific information (e.g. your name) in those -files. - -Lets' run this command to fork the repo, and clone it on your laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+To customise this configuration for yourself, you'll need to **fork** the repository to your own Github account. +**Forking** creates a copy of the repository under your account (`your_github_username/dotfiles`), which you can then modify with your personal information, such as your name.
- - I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI) but I have a new laptop - +If you already did another Le Wagon bootcamp (Web Development, AI Software Development, Data Analytics, Data Science & AI, open a ticket with a TA and open this for instructions ❗ + -This means that you already forked the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - -First, clone your fork on this machine: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone $GITHUB_USERNAME/dotfiles -``` +You may have an older version of the Le Wagon dotfiles. They could be incompatible with the current setup. -Open your terminal and go to your `dotfiles` project: +**Together with a TA**, do one of the following: -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles -``` +
+I'm using the same machine (or a new machine which already has the dotfiles). -Time to merge the changes from `lewagon/dotfiles` into yours: -1. Commit your current version of your dotfiles: +1. Move into your existing dotfiles folder: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` - -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Check the diff against the current version of Le Wagon's dotfiles: + ```bash + git diff upstream/master + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +If there is no meaningful difference other than your name and email setting, continue with the setup. -1. If nothing seems out of the ordinary, continue +
- Too many conflicts? - +I'm using a new machine without the dotfiles. - Let's just take over the current version from `lewagon/dotfiles`. +1. Browse to GitHub and find your `dotfiles` repository. - First abort the merge: `git merge --abort`. +1. Check how many commits it's behind and ahead `lewagon/dotfiles:master`. You can see this just above the file list. - Run `code .` +1. Click through to the behind and the ahead, and scroll down to see the diffs. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. - - Still in VS Code, 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. +If there is no meaningful difference other than your name and email setting, continue with the setup.
-Time to commit your changes and push them. +
+The previous step revealed meaningful differences. -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` +If you are OK with losing your existing dotfiles (recommended): -
+Be aware that this will remove any personal changes you made to your shell configuration, like loading extra utilites, or changing the look and feel of your shell. If you're not aware of any changes you made yourself, this should be fine. +1. Delete your existing dotfiles repository on GitHub. +1. Delete the local repository: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continue with the setup.
- - I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI) 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 Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - +If you do not want to lose your existing dotfiles, we recommend working with branches. Click to open. -Open your terminal and go to your `dotfiles` project: +On your **laptop**, or wherever you have a **local** copy of **your existing version of dotfiles**. -```bash -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 - git commit -m "Version prior to new setup" - ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` + ```bash + git add . + git status # Check what will be committed + git commit -m "Version prior to new setup" + ``` -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Create a branch of your current dotfiles setup, and push to GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +1. Go back to `master`: `git checkout master`. -1. If nothing seems out of the ordinary, continue +1. On local `master`, `git pull upstream master`. -
- Too many conflicts? - +1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. + + It is important that you accept incoming changes to the `.zshrc`, `.zprofile`, and `settings.json` files. Especially anything related to `pyenv` and to Python environments. - Let's just take over the current version from `lewagon/dotfiles`. + If there are too many conficts, use your code editor to replace the contents of the conflicting files with the ones from [the Le Wagon dotfiles](https://www.github.com/lewagon/dotfiles). - First abort the merge: `git merge --abort`. + Commit your conflict resolution: `git commit --no-edit` - Run `code .` +1. Push your changes to GitHub: `git push origin master`. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Continue with the setup. - Still in VS Code, 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. +
-Time to commit your changes and push them. +
+ +Time to fork the repo and clone it on your computer: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - - +If you're asked _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, type `yes` followed by `Enter`. -### Run the dotfiles installer +### Installing the dotfiles -It's time to run the `dotfiles` installer: +Run the `dotfiles` installer with: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Check the emails registered with your GitHub Account. You'll need to pick one at the next step: +Check the emails registered with your GitHub Account. You'll need to pick one in the next step: ```bash gh api user/emails | jq -r '.[].email' @@ -489,196 +432,113 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` :point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. - -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`: - -First, open the `.zshrc` file: - -```bash -code ~/.zshrc -``` -Then: -- Spot the line starting with `plugins=` -- Add `ssh-agent` at the end of the plugins list +:warning: You **need** to put one of the emails listed above from the previous `gh api ...` command. If you don't do that, Kitt will not be able to track your progress. -:heavy_check_mark: Save the `.zshrc` file with `Ctrl` + `S` and close your text editor. +💡 Select the `...@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. -## Installing Python (with [`pyenv`](https://github.com/pyenv/pyenv)) - -### Uninstall `conda` +## direnv -As we are using `pyenv` to install and manage our Python version, we need to uninstall [`conda`](https://docs.conda.io/projects/conda/en/latest/), another package manager you may have on your machine if you previously installed [Anaconda](https://www.anaconda.com/). Thus, we are preventing any possible Python version issue later. +[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. -Check if you have `conda` installed on your machine: -```bash -conda list +``` bash +sudo apt-get update; sudo apt-get install direnv +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -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 - -- Install the Anaconda-Clean package from your terminal and run the cleaning -```bash -conda install anaconda-clean -anaconda-clean --yes -``` -- Remove every Anaconda directories -```bash -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` +## Install Python and dependencies -- Restart your terminal with `exec zsh` -- Remove Anaconda initialization from your `.zshrc`: - - Open the file with `code ~/.zshrc` - - Remove the code lines starting from `>>> conda initialize >>>` to `<<< conda initialize <<<` -
+Your operating system - macOS, or Ubuntu (native, or inside WSL) - comes with a "system Python". That's a Python version your system depends on. We don't mess around with that one. We're going to do a professional setup of Python where you don't mess up your "system Python" and where you'll be able to switch which version you want to use for each project you work on. +To manage different Python versions and virtual environments (you'll discover what that means during the setup lecture), we will use the state-of-the-art [`uv` created by Astral](https://docs.astral.sh/uv/). -### 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 Science 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. +### Install `uv` -First let's install `pyenv` with the following Terminal command: +First, we'll install `uv`: ```bash -git clone https://github.com/pyenv/pyenv.git ~/.pyenv -exec zsh +curl -LsSf https://astral.sh/uv/install.sh | sh ``` -Let's install some [dependencies](https://github.com/pyenv/pyenv/wiki/common-build-problems#prerequisites) needed to build Python from `pyenv`: +Next, restart your shell by running this: ```bash -sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ -libbz2-dev libreadline-dev sqlite3 libsqlite3-dev wget curl llvm \ -libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ -python3-dev +exec zsh ``` -### Install Python +### Create a virtual environment -Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: +Next, we'll create a virtual environment (an isolated environment with Python and the dependencies for the bootcamp): ```bash -pyenv install 3.12.9 +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 ``` -This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! - -
- 🛠 Troubleshooting `pyenv` not found - -If you encounter an error `Command 'pyenv' not found`: execute the following line: +Now that we created this new virtual environment, let's restart our shell to pick it up (this works thanks to the `lewagon/dotfiles` we installed before): ```bash -source ~/.zprofile +exec zsh ``` -Then try to install Python again: +Let's check that everything went right. Run this: ```bash -pyenv install 3.12.9 +which python3 ``` -If `pyenv` is still not found, contact a teacher. - -
-
- +It should return this: -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 3.12.9 -exec zsh +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 ``` -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). -### Setup a virtualenv +If it doesn't, check with a TA! Do not continue with the next step before you solved this! -First let's install this plugin: -```bash -git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv -exec zsh -``` +### Install dependencies -Let's create the virtual environment we are going to use during the whole bootcamp: +Python is great for data, because the community has developed an enormous amount of packages we can re-use. -```bash -pyenv virtualenv 3.12.9 lewagon -``` +Let's install the most common ones: -Let's now set the virtual environment with: -```bash -pyenv global lewagon +``` bash +uv pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -Great! Anytime we'll install Python package, we'll do it in that environment. -### Python packages +## Jupyter Notebook tweaking -Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. +Depending on your system, we need to make some small changes to your Jupyter configuration. -First, let's upgrade `pip`, the tool to install Python Packages from [pypi.org](https://pypi.org). In the latest terminal where the virtualenv `lewagon` is activated, run: +Run this: ```bash -pip install --upgrade pip +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` -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 -``` - - +
+If you are curious about what happens here, click here. -## Jupyter Notebook tweaking +This script adds a configuration to improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. -Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. +If you're using Windows WSL, it also fixes some other problems. -Run the following lines to create a `custom.css` stylesheet in your Jupyter config directory: -```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css -``` +
## Python setup check -### Python and packages check +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -686,42 +546,17 @@ Let's reset your terminal: 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 -``` - -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)" -``` - -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)" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: +Your web browser should open on a `jupyter` window.
- Regular setup - - Your web browser should open on a `jupyter` window. -
- - -
- - Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -739,8 +574,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -752,21 +585,25 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` 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. +In another cell, run: +```python +import pandas as pd +pd.__version__ +``` +This might take a few minutes to run. It should output a version number, `2.2.3`. If not, check with a TA. -## DBeaver +You can close your web browser then terminate the jupyter server with `CTRL` + `C`. -Download and install [DBeaver](https://dbeaver.io/), a free and open source powerful tool to connect to any database, explore the schema and even **run SQL queries**. +Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. ## Docker 🐋 @@ -808,34 +645,41 @@ The following message should print: ## 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. +[Google Cloud](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. + +🚨 If you are a student of the **Part-Time Bootcamp or the Flex bootcamp**, SKIP THIS SECTION FOR NOW! **Google Cloud** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your Google Cloud account too soon 🙅‍♂️ + -🚨 If you are a student of the **Part-Time Bootcamp**, SKIP THIS SECTION FOR NOW! **GCP** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your GCP account too soon 🙅‍♂️ ### Project setup - Go to [Google Cloud](https://console.cloud.google.com/) and create an account if you do not already have one - In the Cloud Console, on the project list, select or create a Cloud project +⚠️ **Important:** When creating a new project, you will see an **Organization** field. Leave this set to **"No organization"**. Do not select or create an organization. Choosing an organization applies restrictions that can prevent you from using Google Cloud services during the bootcamp. + ![](images/gcp-create-project.png) - Give it a name such as `Wagon Bootcamp` for example -- ❗ Check that the field _Location_ is set to _No organization_ ❗ - Notice the `ID` automatically created for the project, e.g. `wagon-bootcamp-123456` ![](images/gcp_project.png) +ℹ️ Note the **Project ID** (e.g. `wagon-bootcamp-123456`) this is **not** the same as the project name you chose (e.g. `Wagon Bootcamp`). You will need the ID later when running terminal commands, but don't worry, you can always find it in Google Cloud. + ### Account language -In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: +In order to facilitate the following of the instructions during the bootcamp, open your Google Cloud 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** @@ -843,7 +687,9 @@ Then switch the language to english: ### Billing account -You will now link your account to your credit card. This step is required or you will not be able to use the services provided by GCP. Do not worry, you will be able to consume most GCP services through free credits throughout the bootcamp. +You will now link your account to your credit card. This step is required or you will not be able to use the services provided by Google Cloud. Do not worry, you will be able to consume most Google Cloud services through free credits throughout the bootcamp. + +⚠️ In some cases, Google may charge your card (around €10) to verify that it is valid. This will unfortunately not be refunded once you are approved, but will be added as credit in Google Cloud that you can use once your free credits have been used or expired. ![](images/gcp-billing.png) @@ -851,18 +697,18 @@ You will now link your account to your credit card. This step is required or you - Click on **MANAGE BILLING ACCOUNTS** - Click on **ADD BILLING ACCOUNT** - Give a name to your billing account, e.g. `My Billing Account` -- Click on "I have read..." and agree the to the terms of service +- Click on "I have read..." and agree to the terms of service - Click on **CONTINUE** - Select your account type: `Individual` - Fill your name and address -You should see that you have a free credit of "$300 credits over the next 90days". +You should see that you have a free credit of "$300 credits over the next 90 days". - Click on card details - Enter your credit card info - Click on **START MY FREE TRIAL** -Once this is done, verify that your billing account is linked to your GCP project. +Once this is done, verify that your billing account is linked to your Google Cloud project. - Select your project - Go to **Billing** @@ -872,14 +718,13 @@ 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. @@ -896,26 +741,26 @@ Download the Revolut app, or go to [revolut](https://www.revolut.com/a-radically Once this is done, select the standard (free) plan. No need to add the card to Apple pay, or ask for a the delivery of a physical card, or add money securely. -You now have a virtual card which we will use for the GCP setup. +You now have a virtual card which we will use for the Google Cloud setup. + +In the main view of the Revolut app -In the main view of the Revolut the app - Click on Ready to use - Click on the card - Click on Show card details -- Note down the references of the virtual credit card and use them in order to proceed with the GCP setup +- Note down the references of the virtual credit card and use them in order to proceed with the Google Cloud setup
👉 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 - You will be asked to send a picture of your credit card (only the last 4 digits, no other info) - In case you used **Revolut**, you can send a screenshot of your virtual credit card (do not forget to remove the validity date from the screenshot) -- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup GCP for the bootcamp using a virtual credit card +- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup Google Cloud for the bootcamp using a virtual credit card You may receive a validation or requests for more information within 30 minutes. @@ -923,7 +768,7 @@ Once the verification goes through, you should receive an email stating that "Yo
-### Enabling GCP services +### Enabling Google Cloud services - Make sure that billing is enabled for your Google Cloud project @@ -931,187 +776,80 @@ Once the verification goes through, you should receive an email stating that "Yo - [Enable the BigQuery and Compute Engine APIs](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (This step may take a few minutes) -### Configure Cloud sdk +That's it for the browser setup! Terminal setup comes later in this guide. -- Authenticate the `gcloud` CLI with the google account you used for GCP -```bash -gcloud auth login -``` +## Google Cloud CLI +### Install `gcloud` -- 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 -```bash -gcloud auth list -``` -- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- List your active account and current project and check your project is present +Install the `gcloud` CLI to communicate with [Google Cloud Platform](https://cloud.google.com/) through your terminal: ```bash -gcloud config list -``` - -### Create a service account key 🔑 - -Now that you have created a `GCP account` and a `project` (identified by its `PROJECT_ID`), we are going to configure the actions (API calls) that you want to allow your code to perform. - -
- 🤔 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 resources 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. - - 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. - - 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. - - In the same way that there may be several projects associated with a GCP account, a project may be composed of several services (any bundle of code, whatever its form factor, that requires the usage of GCP API calls in order to fulfill its purpose). - - GCP requires that the services of the projects using API calls are registered on the platform and their credentials configured through the access granted to a `service account`. - - For the moment we will only need to use a single service and will create the corresponding `service account`. -
- -Since the [service account](https://cloud.google.com/iam/docs/service-accounts) is what identifies your application (and therefore your GCP billing account and ultimately your credit card), you are going to want to be cautious with the next steps. - -⚠️ **Do not share you service account json file 🔑** ⚠️ Do not store it on your desktop, do not store it in your git codebase (even if your git repository is private), do not let it by the coffee machine, do not send it as a tweet. - -#### Go to the Service Accounts page - -Navigate to the GCP service accounts page at [this link](https://console.cloud.google.com/apis/credentials/serviceaccountkey). - -- Select your project in the list of recent projects if asked to. -- If not asked, make sure the right project is selected in the Project selecter list at the top of the page. - -An alternate way to navigate to the Service Accounts page is from the following: - -01 Go to Service Accounts - -#### Create a service account - -- Click on **CREATE SERVICE ACCOUNT**. - - 02 Create Service Account - -- Give your service account a name, an id and a description, and click on **CREATE AND CONTINUE**. - - 03 Name the service account - -- Click on **Select a role** and choose `Basic` then **`Owner`**, which gives the service account full access to all resources of your GCP project. - - 04 Add BigQuery Job User - -- Click on the blue **DONE** button at the bottom of this window. We don't need to worry about the section *Grant your users access to this service account*. - - 04 Done - - -#### Create a json key 🔑 for this service account - -- On the service accounts page, click on the email address of the newly created service account. - - 05 Select the service account - -- Click on the **KEYS** tab at the top of the page. - - 06 Go to Keys - - -- Click on **ADD KEY** then **Create new key**. - - 07 Add Key - - -- Select **JSON** and click on **CREATE**. - - 08 Choose JSON and Create - -- 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 -/home/LINUX_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json +sudo apt-get update && sudo apt-get install ca-certificates gnupg curl +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg +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 update && sudo apt-get install google-cloud-cli ``` +👉 [Install documentation](https://cloud.google.com/sdk/docs/install#deb) -- Store the **absolute path** to the `JSON` file as an environment variable: - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line! -You can do so by running +### Configure the Google Cloud CLI -```bash -code ~/.zshrc -``` +- Authenticate the `gcloud` CLI with the google account you used for GCP -in the Terminal! 😄 + ```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 -
- ℹ️ How to find the absolute path of a file? - You can drag and drop the file in your terminal. -
+ ```bash + gcloud auth list + ``` -**Restart** your terminal and run: +- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` + ```bash + gcloud config set project PROJECT_ID + ``` -The ouptut should be the following: +- List your active account and current project and check your project is present -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` + ```bash + gcloud config list + ``` -Now let's verify that the path to your service account json file is correct: +- Now let's set up Application Default Credentials so your Python code can access GCP: -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` + ```bash + gcloud auth application-default login + ``` -👉 This command should display the content of your service account json file. If it does not, ask for a TA 🙏 + This will open a browser window. Log in with the same Google account you used to create your GCP project. Your credentials will be saved automatically. -Your code and utilities are now able to access the resources of your GCP account. +- Let's verify your Application Default Credentials are working: -Let's proceed with the final steps of configuration... + ```bash + gcloud auth application-default print-access-token + ``` -- List the service accounts associated to your active account and current project -```bash -gcloud iam service-accounts list -``` -- Retrieve the service account email address, e.g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- List the roles of the service account from the cli (replace PROJECT_ID and SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- You should see that your service account has a role of `roles/owner` + You should see a long token string. If you see an error, run `gcloud auth application-default login` again. -
- Troubleshooting +
+ 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 -
+ - `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](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). diff --git a/LINUX_keep_current.es.md b/LINUX_keep_current.es.md index 67b418a9..f698a34b 100644 --- a/LINUX_keep_current.es.md +++ b/LINUX_keep_current.es.md @@ -296,18 +296,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -333,6 +321,15 @@ import sys; sys.version Debería mostrar `3.12.9` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. +En otra celda, ejecuta: + +```python +import pandas as pd +pd.__version___ +``` + +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. + Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. ¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. diff --git a/LINUX_keep_current.md b/LINUX_keep_current.md index 1ee086a1..8b694a2d 100644 --- a/LINUX_keep_current.md +++ b/LINUX_keep_current.md @@ -283,7 +283,7 @@ sudo service docker stop ## Python setup check -### Python and packages check +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -291,42 +291,17 @@ Let's reset your terminal: 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 -``` - -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)" -``` - -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)" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -344,8 +319,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -357,12 +330,22 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` It should output `3.12.9` followed by some more details. If not, check with a TA. +In another cell, run: + +```python +import pandas as pd +pd.__version__ +``` + +This might take a few minutes to run. It should output a version number, `2.2.3`. 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/REMOTE_SETUP.md b/REMOTE_SETUP.md index 3baf11de..45c7b1c0 100644 --- a/REMOTE_SETUP.md +++ b/REMOTE_SETUP.md @@ -1,9 +1,11 @@ # Setup instructions -You will find below the instructions to set up you computer for [Le Wagon Data Science course](https://www.lewagon.com/data-science-course/full-time) +Below are the instructions for setting up your computer for the [Le Wagon Data Science & AI bootcamp](https://www.lewagon.com/data-science-course). -Please **read them carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand: +Please **read them carefully and execute all commands in the following order**. + +This setup is not an exercise; its sole purpose is to prepare your machine in a standardised way. Do not experiment or ask an LLM for help. If you get stuck, simply ask a teacher for help :raising_hand: Let's start :rocket: @@ -455,7 +457,7 @@ For the start of the bootcamp, we’ll disable these features. At the right poin In **VS Code**: -1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS). +1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P`. 1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option. @@ -511,7 +513,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh tree +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` These commands will ask for your password: type it in. @@ -641,179 +643,144 @@ gh auth status ## 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. +Let's enhance the experience of your machine by installing Le Wagon's pre-configured [dotfiles 🔗](https://github.com/lewagon/dotfiles). These are configuration files for your terminal, zsh, git, and VS Code. + -### Check your GitHub CLI configuration +### Get your GitHub username -First, let's do a quick check. Open your terminal and run the following command: +Run the following command: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -You should see your GitHub username printed. If it's not the case, **stop here** and ask for help. -There seems to be a problem with the previous step (`gh auth`). - -### Fork and/or clone dotfiles +✔️ You should see your Github username printed. -There are three options, choose **one**: +❌ If not, stop here and ask for help. There may be a problem with the previous step (`gh auth`). -
- - I did not attend the Web Dev or Data Science & AI bootcamp at Le Wagon - - - As your configuration is personal, you need your own repository storing it, so you'll need to fork it to your GitHub account. +### Forking the dotfiles -Forking means that it will create a new repo in your GitHub account, identical to the original one. You'll have a new repository on your GitHub account, `your_github_username/dotfiles`. We need to fork because each of you will need to put specific information (e.g. your name) in those -files. - -Lets' run this command to fork the repo, and clone it on your laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+To customise this configuration for yourself, you'll need to **fork** the repository to your own Github account. +**Forking** creates a copy of the repository under your account (`your_github_username/dotfiles`), which you can then modify with your personal information, such as your name.
- - I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI) but I have a new laptop - - -This means that you already forked the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** +If you already did another Le Wagon bootcamp (Web Development, AI Software Development, Data Analytics, Data Science & AI, open a ticket with a TA and open this for instructions ❗ + -First, clone your fork on this machine: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone $GITHUB_USERNAME/dotfiles -``` +You may have an older version of the Le Wagon dotfiles. They could be incompatible with the current setup. -Open your terminal and go to your `dotfiles` project: +**Together with a TA**, do one of the following: -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles -``` +
+I'm using the same machine (or a new machine which already has the dotfiles). -Time to merge the changes from `lewagon/dotfiles` into yours: -1. Commit your current version of your dotfiles: +1. Move into your existing dotfiles folder: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` - -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Check the diff against the current version of Le Wagon's dotfiles: + ```bash + git diff upstream/master + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +If there is no meaningful difference other than your name and email setting, continue with the setup. -1. If nothing seems out of the ordinary, continue +
- Too many conflicts? - - - Let's just take over the current version from `lewagon/dotfiles`. +I'm using a new machine without the dotfiles. - First abort the merge: `git merge --abort`. +1. Browse to GitHub and find your `dotfiles` repository. - Run `code .` +1. Check how many commits it's behind and ahead `lewagon/dotfiles:master`. You can see this just above the file list. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Click through to the behind and the ahead, and scroll down to see the diffs. - Still in VS Code, 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. +If there is no meaningful difference other than your name and email setting, continue with the setup.
-Time to commit your changes and push them. +
+The previous step revealed meaningful differences. -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` +If you are OK with losing your existing dotfiles (recommended): -
+Be aware that this will remove any personal changes you made to your shell configuration, like loading extra utilites, or changing the look and feel of your shell. If you're not aware of any changes you made yourself, this should be fine. +1. Delete your existing dotfiles repository on GitHub. +1. Delete the local repository: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continue with the setup.
- - I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI) on the same laptop before - +If you do not want to lose your existing dotfiles, we recommend working with branches. Click to open. -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 Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** +On your **laptop**, or wherever you have a **local** copy of **your existing version of dotfiles**. - -Open your terminal and go to your `dotfiles` project: - -```bash -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 - git commit -m "Version prior to new setup" - ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` + ```bash + git add . + git status # Check what will be committed + git commit -m "Version prior to new setup" + ``` -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Create a branch of your current dotfiles setup, and push to GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +1. Go back to `master`: `git checkout master`. -1. If nothing seems out of the ordinary, continue +1. On local `master`, `git pull upstream master`. -
- Too many conflicts? - +1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. + + It is important that you accept incoming changes to the `.zshrc`, `.zprofile`, and `settings.json` files. Especially anything related to `pyenv` and to Python environments. - Let's just take over the current version from `lewagon/dotfiles`. + If there are too many conficts, use your code editor to replace the contents of the conflicting files with the ones from [the Le Wagon dotfiles](https://www.github.com/lewagon/dotfiles). - First abort the merge: `git merge --abort`. + Commit your conflict resolution: `git commit --no-edit` - Run `code .` +1. Push your changes to GitHub: `git push origin master`. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Continue with the setup. - Still in VS Code, 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. +
-Time to commit your changes and push them. +
+ +Time to fork the repo and clone it on your computer: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - - +If you're asked _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, type `yes` followed by `Enter`. -### Run the dotfiles installer +### Installing the dotfiles -It's time to run the `dotfiles` installer: +Run the `dotfiles` installer with: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Check the emails registered with your GitHub Account. You'll need to pick one at the next step: +Check the emails registered with your GitHub Account. You'll need to pick one in the next step: ```bash gh api user/emails | jq -r '.[].email' @@ -826,9 +793,10 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` :point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. -Please now **quit** all your opened terminal windows. +:warning: You **need** to put one of the emails listed above from the previous `gh api ...` command. If you don't do that, Kitt will not be able to track your progress. + +💡 Select the `...@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. ### zsh default terminal @@ -970,64 +938,46 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs ## 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. +Depending on your system, we need to make some small changes to your Jupyter configuration. -Run the following lines to create a `custom.css` stylesheet in your Jupyter config directory: +Run this: ```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` +
+If you are curious about what happens here, click here. -## Python setup check +This script adds a configuration to improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. -### Python and packages check +If you're using Windows WSL, it also fixes some other problems. -Let's reset your terminal: -```bash -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 -``` -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)" -``` +## Python setup check + +Let's run some checks. If any of the following steps fail, ask a TA for help. + +Let's reset your terminal: -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)" +cd ~/code && exec zsh ``` -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -1045,8 +995,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -1058,21 +1006,25 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` 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. +In another cell, run: +```python +import pandas as pd +pd.__version__ +``` +This might take a few minutes to run. It should output a version number, `2.2.3`. If not, check with a TA. -## DBeaver +You can close your web browser then terminate the jupyter server with `CTRL` + `C`. -Download and install [DBeaver](https://dbeaver.io/), a free and open source powerful tool to connect to any database, explore the schema and even **run SQL queries**. +Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. ## Docker 🐋 diff --git a/VM.es.md b/VM.es.md index 3d5b3131..608f7604 100644 --- a/VM.es.md +++ b/VM.es.md @@ -1,10 +1,13 @@ -# Instrucciones para la configuración -Aquí abajo encontrarás las instrucciones para configurar tu computadora para [el curso de Data Science de Le Wagon](https://www.lewagon.com/data-science-course/full-time) +# Instrucciones de configuración -Por favor **léelas cuidadosamente y ejecuta todos los comandos en el siguiente orden**. Si tienes algún problema, no dudes en pedirle ayuda a una profesor :raising_hand: +A continuación encontrarás las instrucciones para configurar tu ordenador para el [bootcamp de Data Science & AI de Le Wagon](https://www.lewagon.com/data-science-course). -¡Comencemos! :rocket: +Por favor, **léelas detenidamente y ejecuta todos los comandos en el siguiente orden**. + +Esta configuración no es un ejercicio; su único propósito es preparar tu ordenador de forma estandarizada. No experimentes ni pidas ayuda a un LLM. Si te atascas, simplemente pide ayuda a un profesor :raising_hand: + +Empecemos :rocket: ## Cuenta GitHub @@ -257,7 +260,7 @@ Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento En **VS Code**: -1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS). +1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P`. 1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción. @@ -313,7 +316,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` Estos comandos te pedirán tu contraseña: escríbela. @@ -459,182 +462,144 @@ echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FI ## Dotfiles -Los hackers aman mejorar sus shells y sus herramientas. Comenzaremos con una configuración por defecto genial proporcionada por [Le Wagon](http://github.com/lewagon/dotfiles) y almacenada en GitHub. +Mejoremos la experiencia de tu máquina instalando los [dotfiles 🔗](https://github.com/lewagon/dotfiles) preconfigurados de Le Wagon. Son archivos de configuración para tu terminal, zsh, git y VS Code. + -### Verifica tu configuración de GitHub CLI +### Obtener tu nombre de usuario de GitHub -Primero, hagamos una verificación rápida. Abre tu terminal y ejecuta el comando siguiente: +Ejecuta el siguiente comando: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -Deberías ver tu usuario GitHub. Si no es así, **no hagas más nada** y pide ayuda. -Parece que hay un problema con el paso anterior (`gh auth`). - - -### Fork y/o clone los archivos de configuración - -Hay tres opciones, escoge **una**: - - -
- - No he hecho el bootcamp de Web Development o Data Science & AI de Le Wagon - - - Tu configuración es personal, así que necesitas tu propio repositorio para almacenarla. Primero tienes que hacer el fork del repositorio en tu cuenta GitHub. +✔️ Deberías ver tu nombre de usuario de GitHub en la pantalla. -Hacer un fork significa que crearás un nuevo repositorio en tu cuenta GitHub idéntico al original. Tendrás un nuevo repositorio en tu cuenta GitHub, `your_github_username/dotfiles`. El fork es necesario porque cada uno de ustedes necesitará poner información específica (e.g. tu nombre) en esos archivos. +❌ Si no es así, detente aquí y pide ayuda. Puede haber un problema con el paso anterior (`gh auth`). -Ejecutemos este comando para hacer un **fork** del repositorio `lewagon/dotfiles` y clonarlo: +### Crear un fork de los dotfiles -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+Para personalizar esta configuración, tendrás que crear un **fork** del repositorio en tu propia cuenta de GitHub. +Crear un **fork** genera una copia del repositorio en tu cuenta (`your_github_username/dotfiles`), que luego podrás modificar con tus datos personales, como tu nombre.
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon pero tengo una nueva laptop - - -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento.Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** - -Es hora de clonarlo el repositorio en tu laptop: +Si ya hiciste otro bootcamp de Le Wagon (Desarrollo web, Desarrollo de software con IA, Análisis de datos, Ciencia de datos e IA), abre un ticket con un TA y abre esta sección para ver las instrucciones ❗ + -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone lewagon/dotfiles -``` +Es posible que tengas una versión antigua de los dotfiles de Le Wagon. Podrían ser incompatibles con la configuración actual. -Abre tu terminal y ve a tu proyecto `dotfiles`: +**Junto con un TA**, haz una de las siguientes acciones: -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` - -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +
+Estoy usando la misma máquina (o una máquina nueva que ya tiene los dotfiles). -1. Commit la versión actual de tus dotfiles: +1. Ve a tu carpeta actual de dotfiles: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Trae los cambios del repositorio upstream: `git merge upstream/master` +1. Comprueba las diferencias con la versión actual de los dotfiles de Le Wagon: + ```bash + git diff upstream/master + ``` -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración. -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. - -1. Si todo parece estar en orden, continúa. +
- ¿Demasiados conflictos? - +Estoy usando una máquina nueva sin los dotfiles. - Vamos a tomar la versión actual de `lewagon/dotfiles`. +1. Ve a GitHub y encuentra tu repositorio de `dotfiles`. - Primero aborta la merge: `git merge --abort`. +1. Comprueba cuántos commits por detrás y por delante está de `lewagon/dotfiles:master`. Puedes verlo justo encima de la lista de archivos. - Ejecuta `code .` +1. Haz clic en los enlaces de commits por detrás y por delante, y desplázate hacia abajo para ver las diferencias. - En VS Code, 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 VS Code, 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. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración.
-Es hora de guardar tus cambios y subirlos. - -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` - -
- -
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon en la misma laptop - +El paso anterior mostró diferencias importantes. -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento. Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** +Si estás de acuerdo con perder tus dotfiles actuales (recomendado): +Ten en cuenta que esto eliminará cualquier cambio personal que hayas hecho en la configuración de tu shell, como cargar utilidades adicionales o cambiar su apariencia. Si no recuerdas haber hecho cambios, no debería haber ningún problema. -Abre tu terminal y ve a tu proyecto `dotfiles`: +1. Elimina tu repositorio actual de dotfiles en GitHub. +1. Elimina el repositorio local: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continúa con la configuración. -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` +
+Si no quieres perder tus dotfiles actuales, te recomendamos trabajar con ramas. Haz clic para abrir. -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +En tu **portátil**, o donde tengas una copia **local** de **tu versión actual de los dotfiles**. -1. Commit la versión actual de tus dotfiles: - ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" - ``` +1. Haz commit de tu versión actual de los dotfiles: -1. Trae los cambios del repositorio upstream: `git merge upstream/master` + ```bash + git add . + git status # Comprueba qué se incluirá en el commit + git commit -m "Version prior to new setup" + ``` -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +1. Crea una rama de tu configuración actual de dotfiles y súbela a GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. +1. Vuelve a `master`: `git checkout master`. -1. Si todo parece estar en orden, continúa. +1. En tu `master` local, ejecuta `git pull upstream master`. -
- ¿Demasiados conflictos? - +1. Comprueba que no estés en estado `MERGING`. Si lo estás, resuelve los conflictos. + + Es importante que aceptes los cambios entrantes en los archivos `.zshrc`, `.zprofile` y `settings.json`, especialmente todo lo relacionado con `pyenv` y los entornos de Python. - Vamos a tomar la versión actual de `lewagon/dotfiles`. + Si hay demasiados conflictos, usa tu editor de código para reemplazar el contenido de los archivos en conflicto por el de los [dotfiles de Le Wagon](https://www.github.com/lewagon/dotfiles). - Primero aborta la merge: `git merge --abort`. + Haz commit de la resolución de conflictos: `git commit --no-edit` - Ejecuta `code .` +1. Sube tus cambios a GitHub: `git push origin master`. - En VS Code, 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. +1. Continúa con la configuración. - Aún en VS Code, 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. +
-Es hora de guardar tus cambios y subirlos. +
+ +Es hora de crear un fork del repositorio y clonarlo en tu ordenador: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - +Si aparece la pregunta _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, escribe `yes` y pulsa `Enter`. +### Instalar los dotfiles -### Ejecuta el instalador de dotfiles - -Ejecuta el instalador de `dotfiles`. +Ejecuta el instalador de `dotfiles` con: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno de ellos en el próximo paso: +Comprueba los correos electrónicos registrados en tu cuenta de GitHub. Tendrás que elegir uno en el siguiente paso: ```bash gh api user/emails | jq -r '.[].email' @@ -646,10 +611,11 @@ Ejecuta el instalador de git: cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` -:point_up: Esto te **guiará** con tu nombre (`FirstName LastName`) y con tu email. -:warning: Cuidado, **debes** poner uno de los emails de la lista de arriba que te suministra el comando `gh api ...` usado anteriormente. Si haces eso, Kitt no podrá hacerle seguimiento a tu progreso. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir. +:point_up: Se te pedirá tu nombre (`FirstName LastName`) y tu correo electrónico. + +:warning: **Debes** introducir uno de los correos que aparecen arriba, obtenidos con el comando `gh api ...`. Si no lo haces, Kitt no podrá realizar un seguimiento de tu progreso. -Ahora **cierra** todas las ventanas de tu terminal que tengas abiertas por favor. +💡 Selecciona la dirección `...@users.noreply.github.com` si no quieres que tu correo aparezca en repositorios públicos a los que contribuyas. @@ -764,19 +730,26 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs -## Mejora Jupyter Notebook +## Configuración de Jupyter Notebook -Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. +Dependiendo de tu sistema, necesitamos hacer algunos cambios pequeños en tu configuración de Jupyter. -Ejecuta las siguientes líneas para crear una hoja de estilos `custom.css` en tu directorio de configuración de Jupyter: +Ejecuta esto: ```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` +
+Si tienes curiosidad sobre lo que sucede aquí, haz clic aquí. + +Este script añade una configuración para mejorar la visualización de los [elementos `details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. + +Si estás usando Windows WSL, también soluciona otros problemas. + + +
+ ## Chequeo de la configuración de Python @@ -793,18 +766,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -830,15 +791,18 @@ import sys; sys.version Debería mostrar `3.12.9` 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`. - -¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. +En otra celda, ejecuta: +```python +import pandas as pd +pd.__version___ +``` +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. -## DBeaver +Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. -DDescarga e instala [DBeaver](https://dbeaver.io/), una herramienta poderosa, gratuita y de código abierto para conectar con cualquier base de datos, explorar su esquema e incluso **hacer consultas SQL**. +¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. ## Docker 🐋 @@ -878,7 +842,8 @@ Debería aparecer el siguiente mensaje: ![](images/docker_hello.png) - ## Kitt + +## Kitt Deberías haber recibido un correo electrónico de Le Wagon invitándote a registrarte en [Kitt](https://kitt.lewagon.com) (nuestra plataforma de aprendizaje). diff --git a/VM.md b/VM.md index 75901521..a502d2fe 100644 --- a/VM.md +++ b/VM.md @@ -1,9 +1,11 @@ # Setup instructions -You will find below the instructions to set up you computer for [Le Wagon Data Science course](https://www.lewagon.com/data-science-course/full-time) +Below are the instructions for setting up your computer for the [Le Wagon Data Science & AI bootcamp](https://www.lewagon.com/data-science-course). -Please **read them carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand: +Please **read them carefully and execute all commands in the following order**. + +This setup is not an exercise; its sole purpose is to prepare your machine in a standardised way. Do not experiment or ask an LLM for help. If you get stuck, simply ask a teacher for help :raising_hand: Let's start :rocket: @@ -364,7 +366,7 @@ For the start of the bootcamp, we’ll disable these features. At the right poin In **VS Code**: -1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS). +1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P`. 1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option. @@ -420,7 +422,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh tree +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` These commands will ask for your password: type it in. @@ -663,179 +665,144 @@ The browser has now saved the service account json file 🔑 in your downloads d ## 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. +Let's enhance the experience of your machine by installing Le Wagon's pre-configured [dotfiles 🔗](https://github.com/lewagon/dotfiles). These are configuration files for your terminal, zsh, git, and VS Code. + -### Check your GitHub CLI configuration +### Get your GitHub username -First, let's do a quick check. Open your terminal and run the following command: +Run the following command: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -You should see your GitHub username printed. If it's not the case, **stop here** and ask for help. -There seems to be a problem with the previous step (`gh auth`). - -### Fork and/or clone dotfiles - -There are three options, choose **one**: - - -
- - I did not attend the Web Dev or Data Science & AI bootcamp at Le Wagon - +✔️ You should see your Github username printed. - As your configuration is personal, you need your own repository storing it, so you'll need to fork it to your GitHub account. +❌ If not, stop here and ask for help. There may be a problem with the previous step (`gh auth`). -Forking means that it will create a new repo in your GitHub account, identical to the original one. You'll have a new repository on your GitHub account, `your_github_username/dotfiles`. We need to fork because each of you will need to put specific information (e.g. your name) in those -files. -Lets' run this command to fork the repo, and clone it on your laptop: +### Forking the dotfiles -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+To customise this configuration for yourself, you'll need to **fork** the repository to your own Github account. +**Forking** creates a copy of the repository under your account (`your_github_username/dotfiles`), which you can then modify with your personal information, such as your name.
- - I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI) but I have a new laptop - - -This means that you already forked the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - -First, clone your fork on this machine: +If you already did another Le Wagon bootcamp (Web Development, AI Software Development, Data Analytics, Data Science & AI, open a ticket with a TA and open this for instructions ❗ + -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone $GITHUB_USERNAME/dotfiles -``` +You may have an older version of the Le Wagon dotfiles. They could be incompatible with the current setup. -Open your terminal and go to your `dotfiles` project: +**Together with a TA**, do one of the following: -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles -``` +
+I'm using the same machine (or a new machine which already has the dotfiles). -Time to merge the changes from `lewagon/dotfiles` into yours: -1. Commit your current version of your dotfiles: +1. Move into your existing dotfiles folder: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` - -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Check the diff against the current version of Le Wagon's dotfiles: + ```bash + git diff upstream/master + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +If there is no meaningful difference other than your name and email setting, continue with the setup. -1. If nothing seems out of the ordinary, continue +
- Too many conflicts? - - - Let's just take over the current version from `lewagon/dotfiles`. - - First abort the merge: `git merge --abort`. +I'm using a new machine without the dotfiles. - Run `code .` +1. Browse to GitHub and find your `dotfiles` repository. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Check how many commits it's behind and ahead `lewagon/dotfiles:master`. You can see this just above the file list. - Still in VS Code, open the `zprofile` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Save to disk. +1. Click through to the behind and the ahead, and scroll down to see the diffs. - Back in the terminal, run a `git diff` and check if this didn't remove any personal configuration setting that you wanted to keep. +If there is no meaningful difference other than your name and email setting, continue with the setup.
-Time to commit your changes and push them. +
+The previous step revealed meaningful differences. -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` +If you are OK with losing your existing dotfiles (recommended): -
+Be aware that this will remove any personal changes you made to your shell configuration, like loading extra utilites, or changing the look and feel of your shell. If you're not aware of any changes you made yourself, this should be fine. +1. Delete your existing dotfiles repository on GitHub. +1. Delete the local repository: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continue with the setup.
- - I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI) 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 Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - +If you do not want to lose your existing dotfiles, we recommend working with branches. Click to open. -Open your terminal and go to your `dotfiles` project: - -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles -``` +On your **laptop**, or wherever you have a **local** copy of **your existing version of 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 - git commit -m "Version prior to new setup" - ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` + ```bash + git add . + git status # Check what will be committed + git commit -m "Version prior to new setup" + ``` -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Create a branch of your current dotfiles setup, and push to GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +1. Go back to `master`: `git checkout master`. -1. If nothing seems out of the ordinary, continue +1. On local `master`, `git pull upstream master`. -
- Too many conflicts? - +1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. + + It is important that you accept incoming changes to the `.zshrc`, `.zprofile`, and `settings.json` files. Especially anything related to `pyenv` and to Python environments. - Let's just take over the current version from `lewagon/dotfiles`. + If there are too many conficts, use your code editor to replace the contents of the conflicting files with the ones from [the Le Wagon dotfiles](https://www.github.com/lewagon/dotfiles). - First abort the merge: `git merge --abort`. + Commit your conflict resolution: `git commit --no-edit` - Run `code .` +1. Push your changes to GitHub: `git push origin master`. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Continue with the setup. - Still in VS Code, 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. +
-Time to commit your changes and push them. +
+ +Time to fork the repo and clone it on your computer: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - - +If you're asked _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, type `yes` followed by `Enter`. -### Run the dotfiles installer +### Installing the dotfiles -It's time to run the `dotfiles` installer: +Run the `dotfiles` installer with: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Check the emails registered with your GitHub Account. You'll need to pick one at the next step: +Check the emails registered with your GitHub Account. You'll need to pick one in the next step: ```bash gh api user/emails | jq -r '.[].email' @@ -848,9 +815,10 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` :point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. -Please now **quit** all your opened terminal windows. +:warning: You **need** to put one of the emails listed above from the previous `gh api ...` command. If you don't do that, Kitt will not be able to track your progress. + +💡 Select the `...@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. ### zsh default terminal @@ -992,64 +960,46 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs ## 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. +Depending on your system, we need to make some small changes to your Jupyter configuration. -Run the following lines to create a `custom.css` stylesheet in your Jupyter config directory: +Run this: ```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` +
+If you are curious about what happens here, click here. -## Python setup check +This script adds a configuration to improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. -### Python and packages check +If you're using Windows WSL, it also fixes some other problems. -Let's reset your terminal: -```bash -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 -``` -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)" -``` +## Python setup check + +Let's run some checks. If any of the following steps fail, ask a TA for help. + +Let's reset your terminal: -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)" +cd ~/code && exec zsh ``` -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -1067,8 +1017,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -1080,21 +1028,25 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` 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. +In another cell, run: +```python +import pandas as pd +pd.__version__ +``` +This might take a few minutes to run. It should output a version number, `2.2.3`. If not, check with a TA. -## DBeaver +You can close your web browser then terminate the jupyter server with `CTRL` + `C`. -Download and install [DBeaver](https://dbeaver.io/), a free and open source powerful tool to connect to any database, explore the schema and even **run SQL queries**. +Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. ## Docker 🐋 @@ -1134,7 +1086,8 @@ The following message should print: ![](images/docker_hello.png) - ## 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). diff --git a/WINDOWS.es.md b/WINDOWS.es.md index f03e2a3d..23cc548d 100644 --- a/WINDOWS.es.md +++ b/WINDOWS.es.md @@ -1,10 +1,13 @@ -# Instrucciones para la configuración -Aquí abajo encontrarás las instrucciones para configurar tu computadora para [el curso de Data Science de Le Wagon](https://www.lewagon.com/data-science-course/full-time) +# Instrucciones de configuración -Por favor **léelas cuidadosamente y ejecuta todos los comandos en el siguiente orden**. Si tienes algún problema, no dudes en pedirle ayuda a una profesor :raising_hand: +A continuación encontrarás las instrucciones para configurar tu ordenador para el [bootcamp de Data Science & AI de Le Wagon](https://www.lewagon.com/data-science-course). -¡Comencemos! :rocket: +Por favor, **léelas detenidamente y ejecuta todos los comandos en el siguiente orden**. + +Esta configuración no es un ejercicio; su único propósito es preparar tu ordenador de forma estandarizada. No experimentes ni pidas ayuda a un LLM. Si te atascas, simplemente pide ayuda a un profesor :raising_hand: + +Empecemos :rocket: ## Cuenta GitHub @@ -515,7 +518,7 @@ Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento En **VS Code**: -1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS). +1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P`. 1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción. @@ -571,7 +574,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` Estos comandos te pedirán tu contraseña: escríbela. @@ -640,28 +643,6 @@ Reinicia tu terminal: exec zsh ``` -Luego asegúrate de que el siguiente comando devuelva "Browser defined 👌": - -```bash -[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌" -``` - -Si no es así, puedes seguir [estas instrucciones](https://github.com/lewagon/setup/blob/master/_partials/es/windows_browser.md) para configurar tu navegador predeterminado manualmente. - -No dudes en **pedirle ayuda a tu profesor**. - - -## direnv - -[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. - - -``` bash -sudo apt-get update; sudo apt-get install direnv -echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc -``` - - ## GitHub CLI @@ -717,196 +698,146 @@ gh auth status :x: De lo contrario, **contacta a un profesor**. -## CLI de Google Cloud - -Instala la CLI de `gcloud` para comunicar con [Google Cloud Platform](https://cloud.google.com/) a través de la terminal: -```bash -sudo apt-get update && sudo apt-get install ca-certificates gnupg curl -curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg -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 update && sudo apt-get install google-cloud-cli -``` -👉 [Documentación para la instalación](https://cloud.google.com/sdk/docs/install#deb) - - ## Dotfiles -Los hackers aman mejorar sus shells y sus herramientas. Comenzaremos con una configuración por defecto genial proporcionada por [Le Wagon](http://github.com/lewagon/dotfiles) y almacenada en GitHub. +Mejoremos la experiencia de tu máquina instalando los [dotfiles 🔗](https://github.com/lewagon/dotfiles) preconfigurados de Le Wagon. Son archivos de configuración para tu terminal, zsh, git y VS Code. + -### Verifica tu configuración de GitHub CLI +### Obtener tu nombre de usuario de GitHub -Primero, hagamos una verificación rápida. Abre tu terminal y ejecuta el comando siguiente: +Ejecuta el siguiente comando: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -Deberías ver tu usuario GitHub. Si no es así, **no hagas más nada** y pide ayuda. -Parece que hay un problema con el paso anterior (`gh auth`). +✔️ Deberías ver tu nombre de usuario de GitHub en la pantalla. +❌ Si no es así, detente aquí y pide ayuda. Puede haber un problema con el paso anterior (`gh auth`). -### Fork y/o clone los archivos de configuración -Hay tres opciones, escoge **una**: - - -
- - No he hecho el bootcamp de Web Development o Data Science & AI de Le Wagon - +### Crear un fork de los dotfiles - Tu configuración es personal, así que necesitas tu propio repositorio para almacenarla. Primero tienes que hacer el fork del repositorio en tu cuenta GitHub. - -Hacer un fork significa que crearás un nuevo repositorio en tu cuenta GitHub idéntico al original. Tendrás un nuevo repositorio en tu cuenta GitHub, `your_github_username/dotfiles`. El fork es necesario porque cada uno de ustedes necesitará poner información específica (e.g. tu nombre) en esos archivos. - -Ejecutemos este comando para hacer un **fork** del repositorio `lewagon/dotfiles` y clonarlo: - - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+Para personalizar esta configuración, tendrás que crear un **fork** del repositorio en tu propia cuenta de GitHub. +Crear un **fork** genera una copia del repositorio en tu cuenta (`your_github_username/dotfiles`), que luego podrás modificar con tus datos personales, como tu nombre.
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon pero tengo una nueva laptop - +Si ya hiciste otro bootcamp de Le Wagon (Desarrollo web, Desarrollo de software con IA, Análisis de datos, Ciencia de datos e IA), abre un ticket con un TA y abre esta sección para ver las instrucciones ❗ + -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento.Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** +Es posible que tengas una versión antigua de los dotfiles de Le Wagon. Podrían ser incompatibles con la configuración actual. -Es hora de clonarlo el repositorio en tu laptop: -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone lewagon/dotfiles -``` - - -Abre tu terminal y ve a tu proyecto `dotfiles`: - -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` +**Junto con un TA**, haz una de las siguientes acciones: -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +
+Estoy usando la misma máquina (o una máquina nueva que ya tiene los dotfiles). -1. Commit la versión actual de tus dotfiles: +1. Ve a tu carpeta actual de dotfiles: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Trae los cambios del repositorio upstream: `git merge upstream/master` - -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +1. Comprueba las diferencias con la versión actual de los dotfiles de Le Wagon: + ```bash + git diff upstream/master + ``` -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración. -1. Si todo parece estar en orden, continúa. +
- ¿Demasiados conflictos? - - - Vamos a tomar la versión actual de `lewagon/dotfiles`. - - Primero aborta la merge: `git merge --abort`. +Estoy usando una máquina nueva sin los dotfiles. - Ejecuta `code .` +1. Ve a GitHub y encuentra tu repositorio de `dotfiles`. - En VS Code, 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. +1. Comprueba cuántos commits por detrás y por delante está de `lewagon/dotfiles:master`. Puedes verlo justo encima de la lista de archivos. - Aún en VS Code, 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. +1. Haz clic en los enlaces de commits por detrás y por delante, y desplázate hacia abajo para ver las diferencias. - Regresa a la terminal y ejecuta un `git diff` y verifica que esto no haya eliminado ninguna configuración personal que quisieras conservar. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración.
-Es hora de guardar tus cambios y subirlos. - -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` - -
- -
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon en la misma laptop - +El paso anterior mostró diferencias importantes. -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento. Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** +Si estás de acuerdo con perder tus dotfiles actuales (recomendado): +Ten en cuenta que esto eliminará cualquier cambio personal que hayas hecho en la configuración de tu shell, como cargar utilidades adicionales o cambiar su apariencia. Si no recuerdas haber hecho cambios, no debería haber ningún problema. -Abre tu terminal y ve a tu proyecto `dotfiles`: +1. Elimina tu repositorio actual de dotfiles en GitHub. +1. Elimina el repositorio local: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continúa con la configuración. -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` +
+Si no quieres perder tus dotfiles actuales, te recomendamos trabajar con ramas. Haz clic para abrir. -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +En tu **portátil**, o donde tengas una copia **local** de **tu versión actual de los dotfiles**. -1. Commit la versión actual de tus dotfiles: - ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" - ``` +1. Haz commit de tu versión actual de los dotfiles: -1. Trae los cambios del repositorio upstream: `git merge upstream/master` + ```bash + git add . + git status # Comprueba qué se incluirá en el commit + git commit -m "Version prior to new setup" + ``` -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +1. Crea una rama de tu configuración actual de dotfiles y súbela a GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. +1. Vuelve a `master`: `git checkout master`. -1. Si todo parece estar en orden, continúa. +1. En tu `master` local, ejecuta `git pull upstream master`. -
- ¿Demasiados conflictos? - +1. Comprueba que no estés en estado `MERGING`. Si lo estás, resuelve los conflictos. + + Es importante que aceptes los cambios entrantes en los archivos `.zshrc`, `.zprofile` y `settings.json`, especialmente todo lo relacionado con `pyenv` y los entornos de Python. - Vamos a tomar la versión actual de `lewagon/dotfiles`. + Si hay demasiados conflictos, usa tu editor de código para reemplazar el contenido de los archivos en conflicto por el de los [dotfiles de Le Wagon](https://www.github.com/lewagon/dotfiles). - Primero aborta la merge: `git merge --abort`. + Haz commit de la resolución de conflictos: `git commit --no-edit` - Ejecuta `code .` +1. Sube tus cambios a GitHub: `git push origin master`. - En VS Code, 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. +1. Continúa con la configuración. - Aún en VS Code, 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. +
-Es hora de guardar tus cambios y subirlos. +
+ +Es hora de crear un fork del repositorio y clonarlo en tu ordenador: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - - +Si aparece la pregunta _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, escribe `yes` y pulsa `Enter`. -### Ejecuta el instalador de dotfiles +### Instalar los dotfiles -Ejecuta el instalador de `dotfiles`. +Ejecuta el instalador de `dotfiles` con: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno de ellos en el próximo paso: +Comprueba los correos electrónicos registrados en tu cuenta de GitHub. Tendrás que elegir uno en el siguiente paso: ```bash gh api user/emails | jq -r '.[].email' @@ -918,218 +849,112 @@ Ejecuta el instalador de git: cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` -:point_up: Esto te **guiará** con tu nombre (`FirstName LastName`) y con tu email. -:warning: Cuidado, **debes** poner uno de los emails de la lista de arriba que te suministra el comando `gh api ...` usado anteriormente. Si haces eso, Kitt no podrá hacerle seguimiento a tu progreso. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir. +:point_up: Se te pedirá tu nombre (`FirstName LastName`) y tu correo electrónico. -Ahora **cierra** todas las ventanas de tu terminal que tengas abiertas por favor. +:warning: **Debes** introducir uno de los correos que aparecen arriba, obtenidos con el comando `gh api ...`. Si no lo haces, Kitt no podrá realizar un seguimiento de tu progreso. +💡 Selecciona la dirección `...@users.noreply.github.com` si no quieres que tu correo aparezca en repositorios públicos a los que contribuyas. -## Desahilitación de la solicitud de SSH passphrase -No vas a querer que te pidan tu passphrase cada vez que te comuniques con un repositorio remoto. Por eso debes agregarle plugin `ssh-agent` a `oh my zsh`: - -Primero abre el archivo `.zshrc`: - -```bash -code ~/.zshrc -``` +## direnv -Luego: -- Identifica la línea que comienza por `plugins=` -- Agrega `ssh-agent` al final de la lista de plugins +[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. -La lista debería verse de la siguiente manera: -```bash -plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent) +``` bash +sudo apt-get update; sudo apt-get install direnv +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -:heavy_check_mark: Guarda el archivo `.zshrc` con `Ctrl` + `S` y cierra tu editor de texto. -## Instalando Python (con [`pyenv`](https://github.com/pyenv/pyenv)) +## Instalar Python y sus dependencias -### Desinstalar `conda` +Tu sistema operativo - macOS, o Ubuntu (nativo, o dentro de WSL) - viene con un "Python del sistema". Esa es una versión de Python de la que depende tu sistema. No vamos a tocar esa. Vamos a hacer una configuración profesional de Python en la que no estropees tu "Python del sistema" y en la que podrás cambiar la versión que quieras usar para cada proyecto en el que trabajes. -Como estamos utilizando `pyenv` para instalar y gestionar la versión de Python, necesitamos desinstalar [`conda`](https://docs.conda.io/projects/conda/en/latest/), otro gestor de paquetes que podrías tener en tu computadora si previamente instalaste [Anaconda](https://www.anaconda.com/). De esta forma, evitaremos problemas con Python más adelante. +Para gestionar diferentes versiones de Python y entornos virtuales (descubrirás qué significa eso durante la clase de configuración), usaremos la herramienta de última generación [`uv` creada por Astral](https://docs.astral.sh/uv/). -Chequea si tienes `conda` instalado en tu computadora: -```bash -conda list -``` +### Instalar `uv` -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**. +Primero, instalaremos `uv`: - -
- Instrucciones de desinstalación conda - -- Instala el paquete Anaconda-Clean desde tu terminal y comienza la limpieza -```bash -conda install anaconda-clean -anaconda-clean --yes -``` -- Remueve todos los directorios de Anaconda ```bash -rm -rf ~/anaconda2 -rm -rf ~/anaconda3 -rm -rf ~/.anaconda_backup - +curl -LsSf https://astral.sh/uv/install.sh | sh ``` -- 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 - -- Reinicia la terminal con `exec zsh` -- Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - - Abre el archivo con `code ~/.zshrc` - - Remueve las líneas de código desde `>>> conda initialize >>>` hasta `<<< conda initialize <<<` -
- -### Instala `pyenv` - -Ubuntu viene con una versión vieja de Python que no queremos usar. Tal vez ya hayas instalado Anaconda u otro programa para utilizar Python y paquetes de Ciencia de Datos. Si es así, no pasa nada ya que haremos una configuración profesional de Python que te permitirá cambiar de versión cuando quieras al escribir `python` en la terminal. - -Primero instala `pyenv` con el siguiente comando en la Terminal: +A continuación, reinicia tu shell ejecutando esto: ```bash -git clone https://github.com/pyenv/pyenv.git ~/.pyenv exec zsh ``` -Instala algunas [dependencias](https://github.com/pyenv/pyenv/wiki/common-build-problems#prerequisites) necesarias para crear Python desde `pyenv`: - -```bash -sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ -libbz2-dev libreadline-dev sqlite3 libsqlite3-dev wget curl llvm \ -libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ -python3-dev -``` - -### Instala Python +### Crear un entorno virtual -Instala la [última versión estable de Python](https://www.python.org/doc/versions/) que sea aceptada en el currículum de Le Wagon: +A continuación, crearemos un entorno virtual (un entorno aislado con Python y las dependencias del bootcamp): ```bash -pyenv install 3.12.9 +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 ``` -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! - -OK. Cuando este comando termine de ejecutarse, le diremos al sistema que use esta versión de Python **por defecto**. Esto se hace con: +Ahora que hemos creado este nuevo entorno virtual, reiniciemos nuestro shell para que lo detecte (esto funciona gracias a los `lewagon/dotfiles` que instalamos antes): ```bash -pyenv global 3.12.9 exec zsh ``` -Para verificar que esto haya funcionado, ejecuta `python --version`. Si ves `3.12.9`, ¡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). - - -## Entorno Virtual de Python - -Antes de instalar paquetes de Python, aislaremos la configuración del Bootcamp en un entorno virtual **dedicado**. Usaremos un plugin `pyenv` llamado [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). - -### Instala un virtualenv - -Primero instala este plugin: +Comprobemos que todo ha ido bien. Ejecuta esto: ```bash -git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv -exec zsh +which python3 ``` -Crea el entorno virtual que usaremos durante todo el bootcamp: +Debería devolver esto: -```bash -pyenv virtualenv 3.12.9 lewagon -``` -Define el entorno virtual con lo siguiente: - -```bash -pyenv global lewagon +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 ``` -¡Genial! Ahora cada vez que queramos instalar un paquete Python, lo haremos en ese entorno. - -### Paquetes de Python +Si no lo hace, ¡consulta con un TA! No continúes con el siguiente paso hasta que hayas resuelto esto. -Ahora que tenemos el ambiente virtual de `lewagon` adecuado, es hora de instalarle algunos paquetes. -Primero, actualiza `pip`, la herramienta para instalar Paquetes Python desde [pypi.org](https://pypi.org). Ejecuta lo siguiente en la última terminal donde esté activado el virtualenv de `lewagon`: +### Instalar dependencias -```bash -pip install --upgrade pip -``` +Python es genial para datos, porque la comunidad ha desarrollado una enorme cantidad de paquetes que podemos reutilizar. -Ahora instala algunos paquetes para las primeras semanas del programa: +Instalemos los más comunes: ``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt +uv pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -## Mejora Jupyter Notebook - -Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. - -Ejecuta las siguientes líneas para crear una hoja de estilos `custom.css` en tu directorio de configuración de Jupyter: - -```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css -``` +## Configuración de Jupyter Notebook +Dependiendo de tu sistema, necesitamos hacer algunos cambios pequeños en tu configuración de Jupyter. -### Configuración de Jupyter Notebook para abrirlo en tu navegador - -Primero, vamos a configurar tu navegador predeterminado nuevamente. Ya hicimos esto antes, pero cuando instalamos los dotfiles se eliminó la configuración. No hay problema, ejecuta este comando para volver a configurarlo: +Ejecuta esto: ```bash -grep -E "export (GH_)*BROWSER" ~/.zshrc.backup >> ~/.zshrc -``` - -Luego, reinicia tu terminal con: - -```bash -exec zsh -``` - -Genera el archivo de configuración para **Jupyter Notebook**... - -``` bash -jupyter notebook --generate-config -``` - -⚠️ Por favor copia la ruta que arrojó el comando anterior. - -Ahora edita el archivo de configuración de Jupyter generado: - -``` bash -sed -i.backup 's/# c.ServerApp.use_redirect_file = True/c.ServerApp.use_redirect_file = False/' ~/.jupyter/jupyter_notebook_config.py +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` -Intenta usar Jupyter: +
+Si tienes curiosidad sobre lo que sucede aquí, haz clic aquí. -``` bash -jupyter notebook -``` +Este script añade una configuración para mejorar la visualización de los [elementos `details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. -Este comando debió haber abierto una página Jupyter en tu navegador: +Si estás usando Windows WSL, también soluciona otros problemas. -![](images/wsl_jupyter_notebook.png) +- Se asegura de que tu navegador esté configurado correctamente. Ya estaba configurado, pero la configuración de dotfiles lo sobrescribió. +- Soluciona un error conocido en Jupyter Notebook que siempre abre el árbol de directorios, incluso si especificas una ruta de archivo específica. -Si no es el caso, por favor llama a un TA. -Para cerrar el servidor jupyter en la terminal, presiona `CTRL` + `C`, enter y. Luego presiona Enter. +
## Chequeo de la configuración de Python @@ -1147,18 +972,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -1184,75 +997,18 @@ import sys; sys.version Debería mostrar `3.12.9` 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`. - -¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. - - - -## DBeaver - -DDescarga e instala [DBeaver](https://dbeaver.io/), una herramienta poderosa, gratuita y de código abierto para conectar con cualquier base de datos, explorar su esquema e incluso **hacer consultas SQL**. - - -## Parámetros de Windows - -### Intercambio de archivos entre Windows y Ubuntu - -Necesitamos una manera fácil de transferir archivos de Windows a Ubuntu y viceversa. - -Para ello, vamos a crear atajos a directorios Ubuntu en el **Explorador de Archivos** de Windows: -- Abre el Explorador de Archivos de Windows (o usa el atajo `WIN` + `E`) -- En la Barra de Direcciones, coloca `\\wsl$\` (o `\\wsl$\Ubuntu` si eso no funciona) -- Ahora tienes acceso al sistema de archivos de Ubuntu -- Navega por el sistema de archivos de Ubuntu para encontrar los directorios que te interesen -- Arrastra las carpetas que te interesen a la Barra de Direcciones para crear atajos - -![Cómo agregar un atajo al sistema de archivos de Ubuntu en Windows](https://github.com/lewagon/setup/blob/master/images/windows_ubuntu_file_system_shortcut.gif) - -### Abre el Explorador de Archivos de Windows desde la terminal de Ubuntu - -Otra opción para mover archivos es abrir el **Explorador de Archivos** de Windows desde la terminal de Ubuntu: -- Abre una terminal de Ubuntu -- Ve al directorio que quieres explorar -- Ejecuta el comando `explorer.exe .` (Otra alternativa es usar `wslview .`) -- Si obtienes un mensaje de input output error, ejecuta `wsl --shutdown` en una PowerShell de Windows y abre la terminal de Ubuntu nuevamente - -![Cómo abrir Windows Explorer desde la terminal de Ubuntu](https://github.com/lewagon/setup/blob/master/images/windows_explorer_from_terminal.png) - -### Uso del Sistema de Archivos de Ubuntu - -Es posible que quieras averiguar la localización exacta de un directorio en Windows en el sistema de archivos de Ubuntu o viceversa. - -Para convertir una ruta Windows a una Ubuntu y viceversa: -- Abre una terminal de Ubuntu -- Usa el comando `wslpath "C:\Program Files"` para traducir la ruta Windows a una Ubuntu -- Usa el comando `wslpath -w "/home"` para traducir una ruta Ubuntu a una Windows -- El comando `wslpath -w $(pwd)` devuelve la ruta Windows del directorio Ubuntu actual - -![Cómo acceder a una ruta Windows desde una terminal de Ubuntu](https://github.com/lewagon/setup/blob/master/images/windows_path_from_terminal.png) - -### Anclaje de aplicaciones a tu barra de tareas - -Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu barra de tareas para que estén a solo un clic de ti! - -Para ello, abre la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente) y selecciona "Pin to taskbar". - -![Cómo anclar una aplicación a la barra de tareas en Windows](https://github.com/lewagon/setup/blob/master/images/windows_taskbar.png) - -Ancla lo siguiente: -- Tu terminal -- Tu explorador de archivos -- VS Code -- Tu navegador de Internet -- Slack +En otra celda, ejecuta: +```python +import pandas as pd +pd.__version___ +``` -## Visual C++ Redistributable +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. -Algunos paquetes Python requieren de un compilador para funcionar correctamente, así que vamos a instalar uno: +Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. -[For x64 systems](https://aka.ms/vs/16/release/vc_redist.x64.exe) +¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. ## Docker 🐋 @@ -1325,60 +1081,70 @@ Intente `docker info` nuevamente. ## Configuración de Google Cloud Platform -[GCP](https://cloud.google.com/) es una solución en la nube que usarás para colocar tus productos basados en Machine Learning en producción. +[Google Cloud](https://cloud.google.com/) es una solución en la nube que utilizarás para desplegar tus productos basados en Machine Learning en producción. -🚨 Si estás en el grupo de estudiantes del **Bootcamp de Medio Tiempo**, ¡IGNORA ESTA SECCIÓN POR AHORA! **GCP** ofrece $300 en créditos durante 3 meses, así que no es buena idea activar tu cuenta GCP demasiado pronto 🙅‍♂️ +🚨 Si eres estudiante del **Part-Time Bootcamp**, ¡OMITE ESTA SECCIÓN POR AHORA! **Google Cloud** ofrece 300 $ de crédito gratuito durante 3 meses. No querrás activar tu cuenta de Google Cloud demasiado pronto 🙅‍♂️ -### Preparación del Proyecto + + +### Configuración del proyecto - Ve a [Google Cloud](https://console.cloud.google.com/) y crea una cuenta si aún no tienes una -- En la consola de Cloud, en la lista de proyectos, selecciona o crea un proyecto Cloud +- En Cloud Console, en la lista de proyectos, selecciona o crea un proyecto de Cloud + +⚠️ **Importante:** Al crear un proyecto nuevo, verás un campo **Organization**. Déjalo como **"No organization"**. No selecciones ni crees una organización. Elegir una organización aplica restricciones que pueden impedirte utilizar los servicios de Google Cloud durante el bootcamp. ![](images/gcp-create-project.png) -- Asígnale un nombre como `Wagon Bootcamp` por ejemplo -- ❗ Comprueba que el campo _Location_ esté establecido en _No organization_ ❗ -- Verás que se creará un `ID` automáticamente para el proyecto e. g. `wagon-bootcamp-123456` + +- Asígnale un nombre, por ejemplo, `Wagon Bootcamp` +- Observa el `ID` que se crea automáticamente para el proyecto, por ejemplo, `wagon-bootcamp-123456` ![](images/gcp_project.png) +ℹ️ Anota el **Project ID** (por ejemplo, `wagon-bootcamp-123456`), que **no** es lo mismo que el nombre del proyecto que elegiste (por ejemplo, `Wagon Bootcamp`). Necesitarás el ID más adelante al ejecutar comandos en la terminal, pero no te preocupes: siempre puedes encontrarlo en Google Cloud. + ### Idioma de la cuenta -Abre las preferencias en tu cuenta GCP para facilitar el seguimiento de las instrucciones durante el bootcamp: +Para facilitar el seguimiento de las instrucciones durante el bootcamp, abre las preferencias de tu cuenta de Google Cloud: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) -https://myaccount.google.com/language +Si el *idioma preferido* no es: -Si el *idioma de preferencia* no es: - **English** - **United States** -Cámbialo a inglés: -- Haz clic en el logo edición (es una lapicera) +Entonces cambia el idioma a inglés: + +- Haz clic en el icono del lápiz de edición - Selecciona **English** - Selecciona **United States** - Haz clic en **Select** ### Cuenta de facturación -Ahora conecta tu cuenta con tu tarjeta de crédito. Este paso es obligatorio para poder usar los servicios que suministra GCP. No te preocupes, podrás utilizar la mayoría de los servicios de GCP por medio de créditos gratuitos durante el bootcamp. +Ahora vincularás tu cuenta a tu tarjeta de crédito. Este paso es obligatorio; de lo contrario, no podrás utilizar los servicios proporcionados por Google Cloud. No te preocupes: podrás utilizar la mayoría de los servicios de Google Cloud mediante créditos gratuitos durante el bootcamp. + +⚠️ En algunos casos, Google puede hacer un cargo en tu tarjeta (de unos 10 €) para verificar que es válida. Desafortunadamente, no se reembolsará una vez aprobada, pero se añadirá como crédito en Google Cloud que podrás utilizar cuando hayas usado o hayan caducado tus créditos gratuitos. ![](images/gcp-billing.png) - Haz clic en **Billing** - Haz clic en **MANAGE BILLING ACCOUNTS** - Haz clic en **ADD BILLING ACCOUNT** -- Asígnale un nombre a tu cuenta de facturación, e. g. `My Billing Account` -- Haz clic en "I have read..." y acepta los términos de uso +- Ponle un nombre a tu cuenta de facturación, por ejemplo, `My Billing Account` +- Haz clic en "I have read..." y acepta las condiciones del servicio - Haz clic en **CONTINUE** -- Selecciona tu tipo de cuenta: `Individual` -- Agrega tu nombre y dirección +- Selecciona el tipo de cuenta: `Individual` +- Introduce tu nombre y dirección -Verás que tienes créditos gratuitos con un valor de "$300 a utilizar en los próximos 90 días". +Deberías ver que tienes un crédito gratuito de "$300 credits over the next 90 days". -- Haz clic en los detalles de la tarjeta -- Agrega la información de tu tarjeta de crédito -- Haz clic en **START MY FREE TRIAL**. Esto significa comenzar mi período de prueba. +- Haz clic en los datos de la tarjeta +- Introduce los datos de tu tarjeta de crédito +- Haz clic en **START MY FREE TRIAL** -Cuando termines, verifica que la cuenta de facturación esté conectada con tu proyecto GCP. +Una vez hecho esto, verifica que tu cuenta de facturación esté vinculada a tu proyecto de Google Cloud. - Selecciona tu proyecto - Ve a **Billing** @@ -1386,260 +1152,139 @@ Cuando termines, verifica que la cuenta de facturación esté conectada con tu p - Selecciona `My Billing Account` - Haz clic en **SET ACCOUNT** -Ahora deberías ver lo siguiente: +Ahora deberías ver: -``` +```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. ``` -Esto significa Estado de período de prueba: crédito de $300 y 91 días para usarlo - con la full account, tendrás acceso ilimitado a todo lo que ofrece Google Cloud Platform. -
👉 Si no tienes una tarjeta de crédito 👈 +Si no tienes una tarjeta de crédito, una alternativa es crear una cuenta de **Revolut**. +Revolut es una aplicación financiera que te permite crear una tarjeta de crédito virtual vinculada a tu cuenta de facturación del teléfono móvil. -Si no tienes una tarjeta de crédito, puedes abrir una cuenta en **Revolut**. -Revolut es una aplicación que funciona como un banco y que te permitirá crear una tarjeta de crédito virtual conectada a la dirección de facturación de tu smartphone. +Omite este paso si tienes una tarjeta de crédito y la utilizas para la configuración. -Ignora este paso si ya tienes una tarjeta de crédito. Simplemente úsala para hacer la configuración. +Descarga la aplicación Revolut o visita [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la aplicación (introduce tu número de teléfono móvil y haz clic en Get Started). -Descarga la app Revolut o ve a [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la app (introduce tu número de teléfono móvil y haz clic en Get Started). +- Abre la aplicación Revolut +- Introduce tu número de teléfono móvil +- Introduce el código de verificación recibido por SMS +- La aplicación te pedirá tu país, dirección, nombre y apellidos, fecha de nacimiento y dirección de correo electrónico +- La aplicación también te pedirá un selfie y tu profesión +- La aplicación requerirá una foto de tu documento de identidad o pasaporte -- Abre la app Revolut -- Agrega tu número de teléfono móvil -- Agrega el código de verificación que recibiste por SMS -- La app te preguntará por tu país, dirección, primer y segundo nombre, fecha de nacimiento y el email -- La app también te pedirá tu profesión y una selfie -- La app te pedirá una foto de tu documento nacional de identidad o pasaporte +Una vez hecho esto, selecciona el plan estándar (gratuito). No es necesario añadir la tarjeta a Apple Pay, solicitar el envío de una tarjeta física ni añadir dinero. -Cuando termines, selecciona el plan estándar (gratuito). No tienes que agregar la tarjeta a Apple pay, pedir que te envíen una tarjeta a tu domicilio ni tampoco agregar dinero a la cuenta. +Ahora tienes una tarjeta virtual que utilizaremos para configurar Google Cloud. -Ahora tienes una tarjeta virtual que podrás usar para hacer la configuración de GCP. +En la vista principal de la aplicación Revolut -En la vista principal de la app Revolut - Haz clic en Ready to use -- Haz clic en the card +- Haz clic en la tarjeta - Haz clic en Show card details -- Toma nota de la información de la tarjeta de crédito virtual y úsala para completar la configuración de GCP +- Anota los datos de la tarjeta de crédito virtual y utilízalos para continuar con la configuración de Google Cloud
- 👉 Si recibes un email de Google diciendo "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 - + 👉 Si recibes un correo de Google que dice "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 -Esto puede pasar justo después de haber creado la cuenta en Revolut. +Esto puede ocurrir especialmente si acabas de configurar una cuenta de Revolut. - Haz clic en PROCEED TO VERIFICATION -- Te pedirán que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, nada más) -- Si ya has usado **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides quitar la fecha de vencimiento de la captura) -- Explica que estás haciendo el bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta en Revolut para poder configurar GCP para el bootcamp con una tarjeta de crédito virtual +- Se te pedirá que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, sin ninguna otra información) +- Si utilizaste **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides eliminar la fecha de caducidad de la captura) +- Explica que estás asistiendo al bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta de Revolut para configurar Google Cloud para el bootcamp mediante una tarjeta de crédito virtual -Es posible que te validen la cuenta pero también es posible que te pidan más información en los próximos 30 minutos. +Puedes recibir una validación o solicitudes de más información en un plazo de 30 minutos. -Cuando la cuenta sea validada recibirás un email diciendo lo siguiente: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". Esto significa que tu cuenta Google Cloud Platform ha sido restablecida +Una vez completada la verificación, deberías recibir un correo que indique: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.".
-### Habilitación de servicios de GCP - -- Asegúrate de que la facturación está habilitada para tu proyecto Google Cloud - -ℹ️ Tienes un **crédito de $300** para usar con recursos de Google Cloud. Esto será más que suficiente para el bootcamp. - -- [Habilita las APIs BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Esto puede tomar varios minutos) - -### Configuración de Cloud sdk - -- Autentica el CLI de `gcloud` con la cuenta que usaste para GCP -```bash -gcloud auth login -``` -- Inicia sesión en tu cuenta Google en la nueva pestaña que se abrió en tu navegador -- Lista la cuenta que tienes activa y verifica que el email que usaste para GCP está ahí -```bash -gcloud auth list -``` -- Define tu proyecto actual (reemplaza `PROJECT_ID` con el `ID` de tu proyecto e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- Lista la cuenta que tienes activa y tu proyecto actual y verifica que tu proyecto está ahí -```bash -gcloud config list -``` - -### Crea una llave 🔑 de cuenta de servicio - -Como ya creaste una cuenta `GCP account` y un `project` (identificado por su `PROJECT_ID`), vamos a configurar las acciones (llamadas API calls) que quieres que tu código ejecute. - -
- 🤔 ¿Por qué necesitamos una clave de cuenta de servicio? - - - Creaste una `cuenta GCP` conectada a una tarjeta de crédito. Te facturarán de acuerdo al uso que les des a los recursos de **Google Cloud Platform**. El cargo se hará si utilizas algo después de que el período de prueba gratuito se haya terminado o si te excedes del límite de consumo que te permite dicho período. - - En tu `cuenta GCP` has creado un solo `proyecto GCP` identificado por su `PROJECT_ID`. Los `proyectos GCP` te permiten organizar y monitorear la manera en que consumes los recursos **GCP** de forma más precisa. En este bootcamp solo crearemos un solo proyecto. - - Ahora necesitamos una manera de saber qué recursos nuestro código podrá consumir dentro de un `GCP project`. Nuestro código consume recursos GCP por medio de llamadas API. - - Ya que las llamadas API no son gratuitas, es importante definir cuidadosamente cómo nuestro código las utilizará. Sin embargo, durante el bootcamp no habrá restricciones. Le permitiremos a nuestro código que utilice todas las API **GCP** sin restricciones. - - Así como pueden haber varios proyectos asociados a una cuenta GCP, un proyecto puede estar compuesto de muchos servicios (cualquier paquete de código, sin importar su formato, que necesite utilizar llamadas a la API de GCP para cumplir con su propósito). - - GCP exige que los servicios de los proyectos que usen llamadas API se registren en la plataforma y que se configuren sus credenciales por medio del acceso concedido a una `service account`. - - Por ahora solo tendremos que usar un solo servicio y crearemos la `service account` correspondiente. -
- -Ya que la [service account](https://cloud.google.com/iam/docs/service-accounts) es lo que identifica tu aplicación (y por ende tu cuenta de facturación GCP y, en última instancia, tu tarjeta de crédito), lo mejor es ser cuidadoso en los próximos pasos. - -⚠️ **No compartas la 🔑 del archivo json de tu cuenta de servicio** ⚠️ No la guardes en tu escritorio ni en tu código base de git (incluso si tu repositorio git es privado). Que no se te olvide en un lugar como la máquina de café y, por supuesto, no la envíes en un tweet. - -- Ve a la [página de las cuentas de servicio](https://console.cloud.google.com/apis/credentials/serviceaccountkey) -- Selecciona tu proyecto en la lista de proyectos recientes si te piden que -- Crees una cuenta de servicio: - - Haz clic en **CREATE SERVICE ACCOUNT** que significa crear une cuenta de servicio: - - Define un `Service account name` para esa cuenta. Esto significa Nombre de cuenta de servicio - - Haz clic en **CREATE AND CONTINUE** que significa crear y continuar - - Haz clic en **Select a role** que significa selecciona un rol. Escoge `Quick access/Basic` luego **Owner**. Esto otorga acceso total a todos los recursos - - Haz clic en **CONTINUE** - - Haz clic en **DONE** -- Descarga la 🔑 del archivo json de la cuenta de servicio: - - Haz clic en la cuenta de servicio recién creada - - Haz clic en **KEYS** - - Haz clic en **ADD KEY** y luego en **Create new key** - - Selecciona **JSON** y haz clic en **CREATE** - -![](images/gcp_create_key.png) - -El navegador acaba de guardar la 🔑 del archivo json de la cuenta de servicio en tu carpeta de descargas (el nombre se le asigna según el nombre de la cuenta de servicio. Es algo como `le-wagon-data-123456789abc.json`) - - -Ahora vamos a mover el archivo json de la cuenta de servicio desde tu disco en Windows al disco en Ubuntu. Esto le permitirá a las herramientas de desarrollo en Ubuntu acceder a los recursos de tu cuenta GCP. - -Primero crea un directorio para almacenar el archivo. - -👉 Abre una terminal en Ubuntu y ejecuta los siguiente comandos - -🚨 reemplaza el `GITHUB_NICKNAME` por tu nickname de **GitHub** - -``` bash -cd ~/code/GITHUB_NICKNAME -ls -la -``` - -Si el comando no muestra el directorio `dotfiles`, pídele ayuda a un TA 🙏 - -Si no es el caso, puedes proceder con la configuración: - -``` bash -mkdir gcp -``` - -![](images/wsl-gcp-dir.png) - -Ahora moveremos el archivo json de la cuenta de servicio al directorio `gcp` que acabamos de crear. - -Abre un **Buscador de Archivos** de Windows (Win + E) y localiza el directorio `gcp` en el sistema de archivo de Ubuntu. - -Puedes optar por las siguientes alternativas: -- Usar el enlace de **Acceso rápido** que creamos hace un rato -- O escribir la localización del directorio `gcp` manualmente en la barra de direcciones del sistema de archivos de Ubuntu: - -``` -\\wsl$\Ubuntu\home\UBUNTU_USERNAME\code\GITHUB_NICKNAME -``` +### Activación de los servicios de Google Cloud +- Asegúrate de que la facturación esté activada para tu proyecto de Google Cloud -🚨 Si optas por la segunda opción: -- reemplaza el `UBUNTU_USERNAME` por el usuario que escogiste durante la configuración de **Ubuntu** -- reemplaza el `GITHUB_NICKNAME` por tu nickname de **GitHub** +ℹ️ Tienes un **crédito de 300 $** para utilizar en recursos de Google Cloud, más que suficiente para el bootcamp. -![](images/wsl-gcp-key.png) +- [Activa las API de BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Este paso puede tardar unos minutos) -Cuando hayas localizado el directorio `gcp` en el **Buscador de Archivos** de Windows, ponle el archivo json de la cuenta de servicio que descargaste. +¡Eso es todo para la configuración en el navegador! La configuración de la terminal aparece más adelante en esta guía. -Ahora deberías poder ver el archivo desde el sistema de archivos de Ubuntu. -👉 Abre una terminal en Ubuntu y verifica que el archivo json de la cuenta de servicio ha sido movido +## CLI de Google Cloud -``` bash -cd gcp -ls -la +Instala la CLI de `gcloud` para comunicar con [Google Cloud Platform](https://cloud.google.com/) a través de la terminal: +```bash +sudo apt-get update && sudo apt-get install ca-certificates gnupg curl +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg +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 update && sudo apt-get install google-cloud-cli ``` +👉 [Documentación para la instalación](https://cloud.google.com/sdk/docs/install#deb) -![](images/wsl-gcp-dir-2.png) -Si no ves el archivo json de la cuenta de servicio en el directorio `gcp`, pídele ayuda a un TA 🙏 +### Configurar Cloud SDK -Ahora almacenaremos la ruta al archivo json de la cuenta de servicio en una variable de entorno. +- Autentica la CLI de `gcloud` con la cuenta de Google que utilizaste para GCP -🚨 Haz las siguientes sustituciones en este comando: -- El `UBUNTU_USERNAME` por el usuario que escogiste durante la configuración de **Ubuntu** -- El `GITHUB_NICKNAME` por tu nickname de **GitHub** -- El `SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json` por el nombre del archivo json de tu cuenta de servicio. + + ```bash + gcloud auth login --no-launch-browser + ``` + -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/home/UBUNTU_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.aliases -``` +- Inicia sesión en tu cuenta de Google en la nueva pestaña que se abrió en tu navegador web +- Muestra tu cuenta activa y comprueba que aparece la dirección de correo electrónico que utilizaste para GCP + ```bash + gcloud auth list + ``` -
- ℹ️ ¿Cómo encontrar la ruta absoluta de un archivo? - Puedes arrastrar el archivo a tu terminal. -
+- Establece tu proyecto actual (reemplaza `PROJECT_ID` por el `ID` de tu proyecto, por ejemplo, `wagon-bootcamp-123456`) -**Reinicia** tu terminal y ejecuta lo siguiente: + ```bash + gcloud config set project PROJECT_ID + ``` -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` +- Muestra tu cuenta activa y tu proyecto actual, y comprueba que aparece tu proyecto -Deberías obtener la siguiente información: + ```bash + gcloud config list + ``` -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` +- Ahora vamos a configurar las credenciales predeterminadas de la aplicación para que tu código Python pueda acceder a GCP: -Ahora verifica si la ruta al archivo json de tu cuenta de servicio es el correcto: + ```bash + gcloud auth application-default login + ``` -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` + Esto abrirá una ventana del navegador. Inicia sesión con la misma cuenta de Google que utilizaste para crear tu proyecto de GCP. Tus credenciales se guardarán automáticamente. -👉 Este comando debería mostrar el contenido del archivo json de tu cuenta de servicio. Si no es el caso, pídele ayuda a un TA 🙏 +- Verifiquemos que tus credenciales predeterminadas de la aplicación funcionan: -Tu código y utilidades ahora pueden acceder a los recursos de tu cuenta GCP. + ```bash + gcloud auth application-default print-access-token + ``` -Continuemos con los últimos pasos de la configuración... + Deberías ver una cadena de token larga. Si aparece un error, vuelve a ejecutar `gcloud auth application-default login`. -- Lista las cuentas de servicio asociadas a tu cuenta activa y a tu proyecto actual -```bash -gcloud iam service-accounts list -``` -- Recupera el email de la cuenta de servicio e. g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- Lista los roles de la cuenta de servicio desde la cli (reemplaza el PROJECT_ID y el SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- Ahora deberías ver que tu cuenta de servicio tiene el rol de `roles/owner` +
+ Solución de problemas -
- Resolución de problemas + - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` + - Asegúrate de que la facturación esté habilitada para tu proyecto de Google Cloud Platform [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project) +
-- `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.`. Esto significa que el proyecto a facturar está asociado a una cuenta de facturación que no está habilitada - - Asegúrate de habilitar la facturación para tu proyecto https://cloud.google.com/billing/docs/how-to/modify-project -
+🏁 ¡Has terminado la configuración de GCP! -🏁 Listo. ¡Has terminado la configuración de GCP! - ## Kitt +## Kitt Deberías haber recibido un correo electrónico de Le Wagon invitándote a registrarte en [Kitt](https://kitt.lewagon.com) (nuestra plataforma de aprendizaje). @@ -1687,6 +1332,59 @@ Para asegurarte de que todo lo relacionado a videollamadas funcione bien, prueba ¡También puedes instalar la aplicación Slack en tu smartphone e iniciar sesión en `lewagon-alumni`! +## Parámetros de Windows + +### Intercambio de archivos entre Windows y Ubuntu + +Necesitamos una manera fácil de transferir archivos de Windows a Ubuntu y viceversa. + +Para ello, vamos a crear atajos a directorios Ubuntu en el **Explorador de Archivos** de Windows: +- Abre el Explorador de Archivos de Windows (o usa el atajo `WIN` + `E`) +- En la Barra de Direcciones, coloca `\\wsl$\` (o `\\wsl$\Ubuntu` si eso no funciona) +- Ahora tienes acceso al sistema de archivos de Ubuntu +- Navega por el sistema de archivos de Ubuntu para encontrar los directorios que te interesen +- Arrastra las carpetas que te interesen a la Barra de Direcciones para crear atajos + +![Cómo agregar un atajo al sistema de archivos de Ubuntu en Windows](https://github.com/lewagon/setup/blob/master/images/windows_ubuntu_file_system_shortcut.gif) + +### Abre el Explorador de Archivos de Windows desde la terminal de Ubuntu + +Otra opción para mover archivos es abrir el **Explorador de Archivos** de Windows desde la terminal de Ubuntu: +- Abre una terminal de Ubuntu +- Ve al directorio que quieres explorar +- Ejecuta el comando `explorer.exe .` (Otra alternativa es usar `wslview .`) +- Si obtienes un mensaje de input output error, ejecuta `wsl --shutdown` en una PowerShell de Windows y abre la terminal de Ubuntu nuevamente + +![Cómo abrir Windows Explorer desde la terminal de Ubuntu](https://github.com/lewagon/setup/blob/master/images/windows_explorer_from_terminal.png) + +### Uso del Sistema de Archivos de Ubuntu + +Es posible que quieras averiguar la localización exacta de un directorio en Windows en el sistema de archivos de Ubuntu o viceversa. + +Para convertir una ruta Windows a una Ubuntu y viceversa: +- Abre una terminal de Ubuntu +- Usa el comando `wslpath "C:\Program Files"` para traducir la ruta Windows a una Ubuntu +- Usa el comando `wslpath -w "/home"` para traducir una ruta Ubuntu a una Windows +- El comando `wslpath -w $(pwd)` devuelve la ruta Windows del directorio Ubuntu actual + +![Cómo acceder a una ruta Windows desde una terminal de Ubuntu](https://github.com/lewagon/setup/blob/master/images/windows_path_from_terminal.png) + +### Anclaje de aplicaciones a tu barra de tareas + +Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu barra de tareas para que estén a solo un clic de ti! + +Para ello, abre la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente) y selecciona "Pin to taskbar". + +![Cómo anclar una aplicación a la barra de tareas en Windows](https://github.com/lewagon/setup/blob/master/images/windows_taskbar.png) + +Ancla lo siguiente: +- Tu terminal +- Tu explorador de archivos +- VS Code +- Tu navegador de Internet +- Slack + + ## Kata (Extra) Si has terminado la configuración, te pedimos que preguntes si alguien necesita ayuda con la suya (macOS, Linux o Windows). Las primeras clases son a las 2pm. Hablaremos de la configuración que acabas de hacer y de Kitt. diff --git a/WINDOWS.md b/WINDOWS.md index 448be73f..7b16bcd0 100644 --- a/WINDOWS.md +++ b/WINDOWS.md @@ -1,9 +1,11 @@ # Setup instructions -You will find below the instructions to set up you computer for [Le Wagon Data Science course](https://www.lewagon.com/data-science-course/full-time) +Below are the instructions for setting up your computer for the [Le Wagon Data Science & AI bootcamp](https://www.lewagon.com/data-science-course). -Please **read them carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand: +Please **read them carefully and execute all commands in the following order**. + +This setup is not an exercise; its sole purpose is to prepare your machine in a standardised way. Do not experiment or ask an LLM for help. If you get stuck, simply ask a teacher for help :raising_hand: Let's start :rocket: @@ -292,57 +294,6 @@ At first launch, you will be asked some information: :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` -- Type `cmd` -- Press `Enter` - -Type the following command: - -```bash -wsl -l -v -``` - -:heavy_check_mark: If the version of Ubuntu WSL is 2, you are good to go :+1: - -:x: If the version of Ubuntu WSL is 1, we will need to convert it to version 2. - -
- Convert Ubuntu WSL V1 to V2 - - In the Command Prompt window, type: - - ```bash - wsl --set-version Ubuntu 2 - ``` - - :heavy_check_mark: After a few seconds, you should get the following message: `The conversion is complete`. - - :x: If it does not work, we need to be sure that Ubuntu files are not compressed. - -
- 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`. - - Apply changes to this folder only and try to convert the Ubuntu WSL version again. - - :x: If the conversion still does not work, please **contact a teacher**. -
- -You can close this terminal now. - -
- ### Check your username Type this in the Ubuntu terminal: @@ -522,7 +473,7 @@ For the start of the bootcamp, we’ll disable these features. At the right poin In **VS Code**: -1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS). +1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P`. 1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option. @@ -578,7 +529,7 @@ sudo apt update ``` ```bash -sudo apt install -y curl git imagemagick jq unzip vim zsh tree +sudo apt install -y curl git imagemagick jq unzip vim zsh tree direnv ``` These commands will ask for your password: type it in. @@ -656,28 +607,6 @@ Reset your terminal: exec zsh ``` -Then please make sure that the following command returns "Browser defined 👌": - -```bash -[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌" -``` - -If it does not, you can follow [these instructions](https://github.com/lewagon/setup/blob/master/_partials/windows_browser.md) to set your default browser manually. - -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 @@ -733,193 +662,146 @@ 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 -sudo apt-get update && sudo apt-get install ca-certificates gnupg curl -curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg -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 update && sudo apt-get install google-cloud-cli -``` -👉 [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. +Let's enhance the experience of your machine by installing Le Wagon's pre-configured [dotfiles 🔗](https://github.com/lewagon/dotfiles). These are configuration files for your terminal, zsh, git, and VS Code. + -### Check your GitHub CLI configuration +### Get your GitHub username -First, let's do a quick check. Open your terminal and run the following command: +Run the following command: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -You should see your GitHub username printed. If it's not the case, **stop here** and ask for help. -There seems to be a problem with the previous step (`gh auth`). - -### Fork and/or clone dotfiles +✔️ You should see your Github username printed. -There are three options, choose **one**: +❌ If not, stop here and ask for help. There may be a problem with the previous step (`gh auth`). -
- - I did not attend the Web Dev or Data Science & AI bootcamp at Le Wagon - - - As your configuration is personal, you need your own repository storing it, so you'll need to fork it to your GitHub account. +### Forking the dotfiles -Forking means that it will create a new repo in your GitHub account, identical to the original one. You'll have a new repository on your GitHub account, `your_github_username/dotfiles`. We need to fork because each of you will need to put specific information (e.g. your name) in those -files. - -Lets' run this command to fork the repo, and clone it on your laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+To customise this configuration for yourself, you'll need to **fork** the repository to your own Github account. +**Forking** creates a copy of the repository under your account (`your_github_username/dotfiles`), which you can then modify with your personal information, such as your name.
- - I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI) but I have a new laptop - - -This means that you already forked the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - -First, clone your fork on this machine: +If you already did another Le Wagon bootcamp (Web Development, AI Software Development, Data Analytics, Data Science & AI, open a ticket with a TA and open this for instructions ❗ + -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone $GITHUB_USERNAME/dotfiles -``` +You may have an older version of the Le Wagon dotfiles. They could be incompatible with the current setup. -Open your terminal and go to your `dotfiles` project: +**Together with a TA**, do one of the following: -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles -``` +
+I'm using the same machine (or a new machine which already has the dotfiles). -Time to merge the changes from `lewagon/dotfiles` into yours: -1. Commit your current version of your dotfiles: +1. Move into your existing dotfiles folder: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` +1. Check the diff against the current version of Le Wagon's dotfiles: + ```bash + git diff upstream/master + ``` -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. - -1. Do a `git diff HEAD~1 HEAD` to check what changed. +If there is no meaningful difference other than your name and email setting, continue with the setup. -1. If nothing seems out of the ordinary, continue +
- Too many conflicts? - +I'm using a new machine without the dotfiles. - Let's just take over the current version from `lewagon/dotfiles`. +1. Browse to GitHub and find your `dotfiles` repository. - First abort the merge: `git merge --abort`. +1. Check how many commits it's behind and ahead `lewagon/dotfiles:master`. You can see this just above the file list. - Run `code .` +1. Click through to the behind and the ahead, and scroll down to see the diffs. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. - - Still in VS Code, 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. +If there is no meaningful difference other than your name and email setting, continue with the setup.
-Time to commit your changes and push them. +
+The previous step revealed meaningful differences. -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` +If you are OK with losing your existing dotfiles (recommended): -
+Be aware that this will remove any personal changes you made to your shell configuration, like loading extra utilites, or changing the look and feel of your shell. If you're not aware of any changes you made yourself, this should be fine. +1. Delete your existing dotfiles repository on GitHub. +1. Delete the local repository: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continue with the setup.
- - I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI) 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 Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - +If you do not want to lose your existing dotfiles, we recommend working with branches. Click to open. -Open your terminal and go to your `dotfiles` project: +On your **laptop**, or wherever you have a **local** copy of **your existing version of dotfiles**. -```bash -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 - git commit -m "Version prior to new setup" - ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` + ```bash + git add . + git status # Check what will be committed + git commit -m "Version prior to new setup" + ``` -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Create a branch of your current dotfiles setup, and push to GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +1. Go back to `master`: `git checkout master`. -1. If nothing seems out of the ordinary, continue +1. On local `master`, `git pull upstream master`. -
- Too many conflicts? - +1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. + + It is important that you accept incoming changes to the `.zshrc`, `.zprofile`, and `settings.json` files. Especially anything related to `pyenv` and to Python environments. - Let's just take over the current version from `lewagon/dotfiles`. + If there are too many conficts, use your code editor to replace the contents of the conflicting files with the ones from [the Le Wagon dotfiles](https://www.github.com/lewagon/dotfiles). - First abort the merge: `git merge --abort`. + Commit your conflict resolution: `git commit --no-edit` - Run `code .` +1. Push your changes to GitHub: `git push origin master`. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Continue with the setup. - Still in VS Code, 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. +
-Time to commit your changes and push them. +
+ +Time to fork the repo and clone it on your computer: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` - - +If you're asked _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, type `yes` followed by `Enter`. -### Run the dotfiles installer +### Installing the dotfiles -It's time to run the `dotfiles` installer: +Run the `dotfiles` installer with: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Check the emails registered with your GitHub Account. You'll need to pick one at the next step: +Check the emails registered with your GitHub Account. You'll need to pick one in the next step: ```bash gh api user/emails | jq -r '.[].email' @@ -932,236 +814,116 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` :point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. - -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`: - -First, open the `.zshrc` file: -```bash -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. +:warning: You **need** to put one of the emails listed above from the previous `gh api ...` command. If you don't do that, Kitt will not be able to track your progress. +💡 Select the `...@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. -## Installing Python (with [`pyenv`](https://github.com/pyenv/pyenv)) -### Uninstall `conda` +## direnv -As we are using `pyenv` to install and manage our Python version, we need to uninstall [`conda`](https://docs.conda.io/projects/conda/en/latest/), another package manager you may have on your machine if you previously installed [Anaconda](https://www.anaconda.com/). Thus, we are preventing any possible Python version issue later. +[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. -Check if you have `conda` installed on your machine: -```bash -conda list +``` bash +sudo apt-get update; sudo apt-get install direnv +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -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 - -- Install the Anaconda-Clean package from your terminal and run the cleaning -```bash -conda install anaconda-clean -anaconda-clean --yes -``` -- Remove every Anaconda directories -```bash -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` - - Remove the code lines starting from `>>> conda initialize >>>` to `<<< conda initialize <<<` -
+## Install Python and dependencies -### Install `pyenv` +Your operating system - macOS, or Ubuntu (native, or inside WSL) - comes with a "system Python". That's a Python version your system depends on. We don't mess around with that one. We're going to do a professional setup of Python where you don't mess up your "system Python" and where you'll be able to switch which version you want to use for each project you work on. -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 Science 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. +To manage different Python versions and virtual environments (you'll discover what that means during the setup lecture), we will use the state-of-the-art [`uv` created by Astral](https://docs.astral.sh/uv/). -First let's install `pyenv` with the following Terminal command: -```bash -git clone https://github.com/pyenv/pyenv.git ~/.pyenv -exec zsh -``` +### Install `uv` -Let's install some [dependencies](https://github.com/pyenv/pyenv/wiki/common-build-problems#prerequisites) needed to build Python from `pyenv`: +First, we'll install `uv`: ```bash -sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ -libbz2-dev libreadline-dev sqlite3 libsqlite3-dev wget curl llvm \ -libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ -python3-dev +curl -LsSf https://astral.sh/uv/install.sh | sh ``` -### Install Python - -Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: +Next, restart your shell by running this: ```bash -pyenv install 3.12.9 +exec zsh ``` -This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! - -
- 🛠 Troubleshooting `pyenv` not found +### Create a virtual environment -If you encounter an error `Command 'pyenv' not found`: execute the following line: +Next, we'll create a virtual environment (an isolated environment with Python and the dependencies for the bootcamp): ```bash -source ~/.zprofile +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 ``` -Then try to install Python again: +Now that we created this new virtual environment, let's restart our shell to pick it up (this works thanks to the `lewagon/dotfiles` we installed before): ```bash -pyenv install 3.12.9 -``` - -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 3.12.9 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). - -### Setup a virtualenv - -First let's install this plugin: +Let's check that everything went right. Run this: ```bash -git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv -exec zsh +which python3 ``` -Let's create the virtual environment we are going to use during the whole bootcamp: +It should return this: -```bash -pyenv virtualenv 3.12.9 lewagon -``` - -Let's now set the virtual environment with: -```bash -pyenv global lewagon +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 ``` -Great! Anytime we'll install Python package, we'll do it in that environment. - -### Python packages +If it doesn't, check with a TA! Do not continue with the next step before you solved this! -Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. -First, let's upgrade `pip`, the tool to install Python Packages from [pypi.org](https://pypi.org). In the latest terminal where the virtualenv `lewagon` is activated, run: +### Install dependencies -```bash -pip install --upgrade pip -``` +Python is great for data, because the community has developed an enormous amount of packages we can re-use. -Then let's install some packages for the first weeks of the program: +Let's install the most common ones: ``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt +uv pip install -r https://raw.githubusercontent.com/lewagon/data-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. - -Run the following lines to create a `custom.css` stylesheet in your Jupyter config directory: - -```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css -``` - - - -### Configuring Jupyter Notebook to open in your browser +Depending on your system, we need to make some small changes to your Jupyter configuration. -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: +Run this: ```bash -grep -E "export (GH_)*BROWSER" ~/.zshrc.backup >> ~/.zshrc +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` -Then, restart your terminal with: - -```bash -exec zsh -``` - -Let's generate the configuration file for **Jupyter Notebook**... - -``` bash -jupyter notebook --generate-config -``` - -We will now edit the generated Jupyter configuration file: - -``` bash -sed -i.backup 's/# c.ServerApp.use_redirect_file = True/c.ServerApp.use_redirect_file = False/' ~/.jupyter/jupyter_notebook_config.py -``` +
+If you are curious about what happens here, click here. -Let's try to run Jupyter: +This script adds a configuration to improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. -``` bash -jupyter notebook -``` - -This command should have opened a Jupyter page in your browser: +If you're using Windows WSL, it also fixes some other problems. -![](images/wsl_jupyter_notebook.png) +- It makes sure your browser is configured correctly. It was configured before, but was overwritten by the dotfiles setup. +- It fixes a known bug with Jupyter Notebook always opening the directory tree, even if you specify a specific file path. -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 +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -1169,42 +931,17 @@ Let's reset your terminal: 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 -``` - -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)" -``` - -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)" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -1222,8 +959,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -1235,81 +970,25 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` 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. - - - -## DBeaver - -Download and install [DBeaver](https://dbeaver.io/), a free and open source powerful tool to connect to any database, explore the schema and even **run SQL queries**. - - -## Windows settings - -### Exchange files between Windows and Ubuntu - -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 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 - -![How to add a shortcut to Ubuntu file system on Windows](https://github.com/lewagon/setup/blob/master/images/windows_ubuntu_file_system_shortcut.gif) - -### 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 .`) -- If you get an input output error message, run `wsl --shutdown` in a Windows PowerShell and reopen an Ubuntu terminal - -![How to launch Windows Explorer from Ubuntu terminal](https://github.com/lewagon/setup/blob/master/images/windows_explorer_from_terminal.png) - -### Find your way in the Ubuntu File System - -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 -- In particular, the `wslpath -w $(pwd)` command returns the Windows path of the current Ubuntu directory - -![How to access a Windows path from Ubuntu terminal](https://github.com/lewagon/setup/blob/master/images/windows_path_from_terminal.png) - -### Pin apps to your taskbar - -You are going to use most of the apps you've installed today really often. Let's pin them to your taskbar so that they are just one click away! - -To pin an app to your taskbar, launch the app, right-click on the icon in the taskbar to bring up the context menu and choose "Pin to taskbar". - -![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 +In another cell, run: +```python +import pandas as pd +pd.__version__ +``` -## Visual C++ Redistributable +This might take a few minutes to run. It should output a version number, `2.2.3`. If not, check with a TA. -Some Python packages require a compiler to function properly. Let's install one: +You can close your web browser then terminate the jupyter server with `CTRL` + `C`. -[For x64 systems](https://aka.ms/vs/16/release/vc_redist.x64.exe) +Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. ## Docker 🐋 @@ -1381,34 +1060,41 @@ Try `docker run hello-world` again. ## 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. +[Google Cloud](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. + +🚨 If you are a student of the **Part-Time Bootcamp or the Flex bootcamp**, SKIP THIS SECTION FOR NOW! **Google Cloud** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your Google Cloud account too soon 🙅‍♂️ + -🚨 If you are a student of the **Part-Time Bootcamp**, SKIP THIS SECTION FOR NOW! **GCP** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your GCP account too soon 🙅‍♂️ ### Project setup - Go to [Google Cloud](https://console.cloud.google.com/) and create an account if you do not already have one - In the Cloud Console, on the project list, select or create a Cloud project +⚠️ **Important:** When creating a new project, you will see an **Organization** field. Leave this set to **"No organization"**. Do not select or create an organization. Choosing an organization applies restrictions that can prevent you from using Google Cloud services during the bootcamp. + ![](images/gcp-create-project.png) - Give it a name such as `Wagon Bootcamp` for example -- ❗ Check that the field _Location_ is set to _No organization_ ❗ - Notice the `ID` automatically created for the project, e.g. `wagon-bootcamp-123456` ![](images/gcp_project.png) +ℹ️ Note the **Project ID** (e.g. `wagon-bootcamp-123456`) this is **not** the same as the project name you chose (e.g. `Wagon Bootcamp`). You will need the ID later when running terminal commands, but don't worry, you can always find it in Google Cloud. + ### Account language -In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: +In order to facilitate the following of the instructions during the bootcamp, open your Google Cloud 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** @@ -1416,7 +1102,9 @@ Then switch the language to english: ### Billing account -You will now link your account to your credit card. This step is required or you will not be able to use the services provided by GCP. Do not worry, you will be able to consume most GCP services through free credits throughout the bootcamp. +You will now link your account to your credit card. This step is required or you will not be able to use the services provided by Google Cloud. Do not worry, you will be able to consume most Google Cloud services through free credits throughout the bootcamp. + +⚠️ In some cases, Google may charge your card (around €10) to verify that it is valid. This will unfortunately not be refunded once you are approved, but will be added as credit in Google Cloud that you can use once your free credits have been used or expired. ![](images/gcp-billing.png) @@ -1424,18 +1112,18 @@ You will now link your account to your credit card. This step is required or you - Click on **MANAGE BILLING ACCOUNTS** - Click on **ADD BILLING ACCOUNT** - Give a name to your billing account, e.g. `My Billing Account` -- Click on "I have read..." and agree the to the terms of service +- Click on "I have read..." and agree to the terms of service - Click on **CONTINUE** - Select your account type: `Individual` - Fill your name and address -You should see that you have a free credit of "$300 credits over the next 90days". +You should see that you have a free credit of "$300 credits over the next 90 days". - Click on card details - Enter your credit card info - Click on **START MY FREE TRIAL** -Once this is done, verify that your billing account is linked to your GCP project. +Once this is done, verify that your billing account is linked to your Google Cloud project. - Select your project - Go to **Billing** @@ -1445,14 +1133,13 @@ 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. @@ -1469,26 +1156,26 @@ Download the Revolut app, or go to [revolut](https://www.revolut.com/a-radically Once this is done, select the standard (free) plan. No need to add the card to Apple pay, or ask for a the delivery of a physical card, or add money securely. -You now have a virtual card which we will use for the GCP setup. +You now have a virtual card which we will use for the Google Cloud setup. + +In the main view of the Revolut app -In the main view of the Revolut the app - Click on Ready to use - Click on the card - Click on Show card details -- Note down the references of the virtual credit card and use them in order to proceed with the GCP setup +- Note down the references of the virtual credit card and use them in order to proceed with the Google Cloud setup
👉 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 - You will be asked to send a picture of your credit card (only the last 4 digits, no other info) - In case you used **Revolut**, you can send a screenshot of your virtual credit card (do not forget to remove the validity date from the screenshot) -- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup GCP for the bootcamp using a virtual credit card +- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup Google Cloud for the bootcamp using a virtual credit card You may receive a validation or requests for more information within 30 minutes. @@ -1496,7 +1183,7 @@ Once the verification goes through, you should receive an email stating that "Yo
-### Enabling GCP services +### Enabling Google Cloud services - Make sure that billing is enabled for your Google Cloud project @@ -1504,243 +1191,80 @@ Once the verification goes through, you should receive an email stating that "Yo - [Enable the BigQuery and Compute Engine APIs](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (This step may take a few minutes) -### Configure Cloud sdk +That's it for the browser setup! Terminal setup comes later in this guide. -- Authenticate the `gcloud` CLI with the google account you used for GCP -```bash -gcloud auth login --no-launch-browser -``` +## Google Cloud CLI +### Install `gcloud` -- 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 -```bash -gcloud auth list -``` -- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- List your active account and current project and check your project is present +Install the `gcloud` CLI to communicate with [Google Cloud Platform](https://cloud.google.com/) through your terminal: ```bash -gcloud config list -``` - -### Create a service account key 🔑 - -Now that you have created a `GCP account` and a `project` (identified by its `PROJECT_ID`), we are going to configure the actions (API calls) that you want to allow your code to perform. - -
- 🤔 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 resources 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. - - 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. - - 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. - - In the same way that there may be several projects associated with a GCP account, a project may be composed of several services (any bundle of code, whatever its form factor, that requires the usage of GCP API calls in order to fulfill its purpose). - - GCP requires that the services of the projects using API calls are registered on the platform and their credentials configured through the access granted to a `service account`. - - For the moment we will only need to use a single service and will create the corresponding `service account`. -
- -Since the [service account](https://cloud.google.com/iam/docs/service-accounts) is what identifies your application (and therefore your GCP billing account and ultimately your credit card), you are going to want to be cautious with the next steps. - -⚠️ **Do not share you service account json file 🔑** ⚠️ Do not store it on your desktop, do not store it in your git codebase (even if your git repository is private), do not let it by the coffee machine, do not send it as a tweet. - -#### Go to the Service Accounts page - -Navigate to the GCP service accounts page at [this link](https://console.cloud.google.com/apis/credentials/serviceaccountkey). - -- Select your project in the list of recent projects if asked to. -- If not asked, make sure the right project is selected in the Project selecter list at the top of the page. - -An alternate way to navigate to the Service Accounts page is from the following: - -01 Go to Service Accounts - -#### Create a service account - -- Click on **CREATE SERVICE ACCOUNT**. - - 02 Create Service Account - -- Give your service account a name, an id and a description, and click on **CREATE AND CONTINUE**. - - 03 Name the service account - -- Click on **Select a role** and choose `Basic` then **`Owner`**, which gives the service account full access to all resources of your GCP project. - - 04 Add BigQuery Job User - -- Click on the blue **DONE** button at the bottom of this window. We don't need to worry about the section *Grant your users access to this service account*. - - 04 Done - - -#### Create a json key 🔑 for this service account - -- On the service accounts page, click on the email address of the newly created service account. - - 05 Select the service account - -- Click on the **KEYS** tab at the top of the page. - - 06 Go to Keys - - -- Click on **ADD KEY** then **Create new key**. - - 07 Add Key - - -- Select **JSON** and click on **CREATE**. - - 08 Choose JSON and Create - -- 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. - -👉 Open an Ubuntu terminal and run the following commands - -🚨 replace `GITHUB_NICKNAME` by your **GitHub** nickname - -``` bash -cd ~/code/GITHUB_NICKNAME -ls -la -``` - -If the command does not show the `dotfiles` directory, ask for a TA 🙏 - -Otherwise, you can proceed with the setup: - -``` bash -mkdir gcp -``` - -![](images/wsl-gcp-dir.png) - -We will now move the service account json file to the `gcp` directory we just created. - -Open a Windows **File Explorer** (Win + E) and locate the `gcp` directory in the Ubuntu file system. - -You can either: -- Use the **Quick access** link that we created earlier -- manually type the location of the `gcp` directory in the Ubuntu file system in the address bar: - -``` -\\wsl$\Ubuntu\home\UBUNTU_USERNAME\code\GITHUB_NICKNAME -``` - - -🚨 if you opt for the second option: -- replace `UBUNTU_USERNAME` by the username that you choose during the **Ubuntu** setup -- replace `GITHUB_NICKNAME` by your **GitHub** nickname - -![](images/wsl-gcp-key.png) - -Once you have located the `gcp` directory in the Windows **File Explorer**, move the service account json file that you downloaded inside of it. - -The file should now be visible from Ubuntu file system. - -👉 Open an Ubuntu terminal and verify that the service account json file has been moved - -``` bash -cd gcp -ls -la +sudo apt-get update && sudo apt-get install ca-certificates gnupg curl +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg +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 update && sudo apt-get install google-cloud-cli ``` +👉 [Install documentation](https://cloud.google.com/sdk/docs/install#deb) -![](images/wsl-gcp-dir-2.png) - -If you do not see the service account json file listed in the `gcp` directory, ask for a TA 🙏 - -We will now store the path to your service account json file in an environment variable. - -🚨 in the following command, replace: -- `UBUNTU_USERNAME` by the username that you choose during the **Ubuntu** setup -- `GITHUB_NICKNAME` by your **GitHub** nickname -- `SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json` by the name of your service account json file -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/home/UBUNTU_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line! +### Configure the Google Cloud CLI -You can do so by running - -```bash -code ~/.zshrc -``` +- Authenticate the `gcloud` CLI with the google account you used for GCP -in the Terminal! 😄 + ```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 -
- ℹ️ How to find the absolute path of a file? - You can drag and drop the file in your terminal. -
+ ```bash + gcloud auth list + ``` -**Restart** your terminal and run: +- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` + ```bash + gcloud config set project PROJECT_ID + ``` -The ouptut should be the following: +- List your active account and current project and check your project is present -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` + ```bash + gcloud config list + ``` -Now let's verify that the path to your service account json file is correct: +- Now let's set up Application Default Credentials so your Python code can access GCP: -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` + ```bash + gcloud auth application-default login + ``` -👉 This command should display the content of your service account json file. If it does not, ask for a TA 🙏 + This will open a browser window. Log in with the same Google account you used to create your GCP project. Your credentials will be saved automatically. -Your code and utilities are now able to access the resources of your GCP account. +- Let's verify your Application Default Credentials are working: -Let's proceed with the final steps of configuration... + ```bash + gcloud auth application-default print-access-token + ``` -- List the service accounts associated to your active account and current project -```bash -gcloud iam service-accounts list -``` -- Retrieve the service account email address, e.g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- List the roles of the service account from the cli (replace PROJECT_ID and SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- You should see that your service account has a role of `roles/owner` + You should see a long token string. If you see an error, run `gcloud auth application-default login` again. -
- Troubleshooting +
+ 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 -
+ - `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](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). @@ -1787,6 +1311,59 @@ 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`! +## Windows settings + +### Exchange files between Windows and Ubuntu + +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 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 + +![How to add a shortcut to Ubuntu file system on Windows](https://github.com/lewagon/setup/blob/master/images/windows_ubuntu_file_system_shortcut.gif) + +### 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 .`) +- If you get an input output error message, run `wsl --shutdown` in a Windows PowerShell and reopen an Ubuntu terminal + +![How to launch Windows Explorer from Ubuntu terminal](https://github.com/lewagon/setup/blob/master/images/windows_explorer_from_terminal.png) + +### Find your way in the Ubuntu File System + +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 +- In particular, the `wslpath -w $(pwd)` command returns the Windows path of the current Ubuntu directory + +![How to access a Windows path from Ubuntu terminal](https://github.com/lewagon/setup/blob/master/images/windows_path_from_terminal.png) + +### Pin apps to your taskbar + +You are going to use most of the apps you've installed today really often. Let's pin them to your taskbar so that they are just one click away! + +To pin an app to your taskbar, launch the app, right-click on the icon in the taskbar to bring up the context menu and choose "Pin to taskbar". + +![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 + + ## (Bonus) Kata 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. diff --git a/WINDOWS_keep_current.es.md b/WINDOWS_keep_current.es.md index 9106eb0f..ef44e067 100644 --- a/WINDOWS_keep_current.es.md +++ b/WINDOWS_keep_current.es.md @@ -288,18 +288,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -325,6 +313,15 @@ import sys; sys.version Debería mostrar `3.12.9` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. +En otra celda, ejecuta: + +```python +import pandas as pd +pd.__version___ +``` + +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. + Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. ¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. diff --git a/WINDOWS_keep_current.md b/WINDOWS_keep_current.md index f12ea962..4f184717 100644 --- a/WINDOWS_keep_current.md +++ b/WINDOWS_keep_current.md @@ -275,7 +275,7 @@ Stop the Docker Desktop app ## Python setup check -### Python and packages check +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -283,42 +283,17 @@ Let's reset your terminal: 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 -``` - -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)" -``` - -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)" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -336,8 +311,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -349,12 +322,22 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` It should output `3.12.9` followed by some more details. If not, check with a TA. +In another cell, run: + +```python +import pandas as pd +pd.__version__ +``` + +This might take a few minutes to run. It should output a version number, `2.2.3`. 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 deleted file mode 100644 index 6a698379..00000000 --- a/_partials/chrome.md +++ /dev/null @@ -1,9 +0,0 @@ -## Chrome - your browser - -Install the Google Chrome browser if you haven't got it already and set it as a __default browser__. - -Follow the steps for your system from this link :point_right: [Install Google Chrome](https://support.google.com/chrome/answer/95346?co=GENIE.Platform%3DDesktop&hl=en-GB) - -__Why Chrome?__ - -We recommend to use it as your default browser as it's most compatible with testing or running your code, as well as working with Google Cloud Platform. Another alternative is Firefox, however we don't recommend using other tools like Opera, Internet Explorer or Safari. diff --git a/_partials/dbeaver.md b/_partials/dbeaver.md deleted file mode 100644 index 0ece6411..00000000 --- a/_partials/dbeaver.md +++ /dev/null @@ -1,4 +0,0 @@ - -## DBeaver - -Download and install [DBeaver](https://dbeaver.io/), a free and open source powerful tool to connect to any database, explore the schema and even **run SQL queries**. diff --git a/_partials/direnv.md b/_partials/direnv.md index 2e434226..08644784 100644 --- a/_partials/direnv.md +++ b/_partials/direnv.md @@ -4,7 +4,7 @@ {% if os == "macos" %} ``` bash -brew install direnv +brew install -y direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` {% elsif os == "windows" %} diff --git a/_partials/dotfiles.md b/_partials/dotfiles.md index 72590a6f..1bfec79a 100644 --- a/_partials/dotfiles.md +++ b/_partials/dotfiles.md @@ -1,19 +1,156 @@ ## 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. +Let's enhance the experience of your machine by installing Le Wagon's pre-configured [dotfiles 🔗](https://github.com/lewagon/dotfiles). These are configuration files for your terminal, zsh, git, and VS Code. -### Check your GitHub CLI configuration -First, let's do a quick check. Open your terminal and run the following command: +### Get your GitHub username + +Run the following command: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -You should see your GitHub username printed. If it's not the case, **stop here** and ask for help. -There seems to be a problem with the previous step (`gh auth`). +✔️ You should see your Github username printed. + +❌ If not, stop here and ask for help. There may be a problem with the previous step (`gh auth`). + + +### Forking the dotfiles + +To customise this configuration for yourself, you'll need to **fork** the repository to your own Github account. + +**Forking** creates a copy of the repository under your account (`your_github_username/dotfiles`), which you can then modify with your personal information, such as your name. + +
+If you already did another Le Wagon bootcamp (Web Development, AI Software Development, Data Analytics, Data Science & AI, open a ticket with a TA and open this for instructions ❗ + + +You may have an older version of the Le Wagon dotfiles. They could be incompatible with the current setup. + + +**Together with a TA**, do one of the following: + +
+I'm using the same machine (or a new machine which already has the dotfiles). + +1. Move into your existing dotfiles folder: + ```bash + cd ~/code/$GITHUB_USERNAME/dotfiles + ``` + +1. Check the diff against the current version of Le Wagon's dotfiles: + ```bash + git diff upstream/master + ``` + +If there is no meaningful difference other than your name and email setting, continue with the setup. + +
+ +
+I'm using a new machine without the dotfiles. + +1. Browse to GitHub and find your `dotfiles` repository. + +1. Check how many commits it's behind and ahead `lewagon/dotfiles:master`. You can see this just above the file list. + +1. Click through to the behind and the ahead, and scroll down to see the diffs. + +If there is no meaningful difference other than your name and email setting, continue with the setup. + +
+ +
+The previous step revealed meaningful differences. + +If you are OK with losing your existing dotfiles (recommended): + +Be aware that this will remove any personal changes you made to your shell configuration, like loading extra utilites, or changing the look and feel of your shell. If you're not aware of any changes you made yourself, this should be fine. + +1. Delete your existing dotfiles repository on GitHub. +1. Delete the local repository: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continue with the setup. + +
+If you do not want to lose your existing dotfiles, we recommend working with branches. Click to open. + +On your **laptop**, or wherever you have a **local** copy of **your existing version of dotfiles**. + +1. Commit your current version of your dotfiles: + + ```bash + git add . + git status # Check what will be committed + git commit -m "Version prior to new setup" + ``` + +1. Create a branch of your current dotfiles setup, and push to GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` + +1. Go back to `master`: `git checkout master`. + +1. On local `master`, `git pull upstream master`. + +1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. + + It is important that you accept incoming changes to the `.zshrc`, `.zprofile`, and `settings.json` files. Especially anything related to `pyenv` and to Python environments. + + If there are too many conficts, use your code editor to replace the contents of the conflicting files with the ones from [the Le Wagon dotfiles](https://www.github.com/lewagon/dotfiles). + + Commit your conflict resolution: `git commit --no-edit` + +1. Push your changes to GitHub: `git push origin master`. + +1. Continue with the setup. + +
+ +
+ +
+ +
+ +Time to fork the repo and clone it on your computer: + +```bash +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone +``` + +If you're asked _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, type `yes` followed by `Enter`. + +### Installing the dotfiles + +Run the `dotfiles` installer with: + +```bash +cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh +``` + +Check the emails registered with your GitHub Account. You'll need to pick one in the next step: + +```bash +gh api user/emails | jq -r '.[].email' +``` + +Run the git installer: + +```bash +cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh +``` + +:point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -### Fork and/or clone dotfiles +:warning: You **need** to put one of the emails listed above from the previous `gh api ...` command. If you don't do that, Kitt will not be able to track your progress. -There are three options, choose **one**: +💡 Select the `...@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. diff --git a/_partials/dotfiles_installer.md b/_partials/dotfiles_installer.md deleted file mode 100644 index f0e0accc..00000000 --- a/_partials/dotfiles_installer.md +++ /dev/null @@ -1,24 +0,0 @@ -### Run the dotfiles installer - -It's time to run the `dotfiles` installer: - -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh -``` - -Check the emails registered with your GitHub Account. You'll need to pick one at the next step: - -```bash -gh api user/emails | jq -r '.[].email' -``` - -Run the git installer: - -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh -``` - -:point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. - -Please now **quit** all your opened terminal windows. diff --git a/_partials/dotfiles_merge_upstream.md b/_partials/dotfiles_merge_upstream.md deleted file mode 100644 index 879e87f5..00000000 --- a/_partials/dotfiles_merge_upstream.md +++ /dev/null @@ -1,49 +0,0 @@ -Open your terminal and go to your `dotfiles` project: - -```bash -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 - git commit -m "Version prior to new setup" - ``` - -1. Let's bring in the changes from upstream: `git merge upstream/master` - -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. - -1. Do a `git diff HEAD~1 HEAD` to check what changed. - -1. If nothing seems out of the ordinary, continue - -
- Too many conflicts? - - - Let's just take over the current version from `lewagon/dotfiles`. - - First abort the merge: `git merge --abort`. - - Run `{{ CODE_EDITOR_CMD }} .` - - 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 {{ 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. - -
- -Time to commit your changes and push them. - -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` - - diff --git a/_partials/dotfiles_new_laptop.md b/_partials/dotfiles_new_laptop.md deleted file mode 100644 index 386941f9..00000000 --- a/_partials/dotfiles_new_laptop.md +++ /dev/null @@ -1,13 +0,0 @@ -
- - I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI) but I have a new laptop - - -This means that you already forked the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** - -First, clone your fork on this machine: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone $GITHUB_USERNAME/dotfiles -``` diff --git a/_partials/dotfiles_new_student.md b/_partials/dotfiles_new_student.md deleted file mode 100644 index 5191f4d7..00000000 --- a/_partials/dotfiles_new_student.md +++ /dev/null @@ -1,18 +0,0 @@ -
- - I did not attend the Web Dev or Data Science & AI bootcamp at Le Wagon - - - As your configuration is personal, you need your own repository storing it, so you'll need to fork it to your GitHub account. - -Forking means that it will create a new repo in your GitHub account, identical to the original one. You'll have a new repository on your GitHub account, `your_github_username/dotfiles`. We need to fork because each of you will need to put specific information (e.g. your name) in those -files. - -Lets' run this command to fork the repo, and clone it on your laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
diff --git a/_partials/dotfiles_same_laptop.md b/_partials/dotfiles_same_laptop.md deleted file mode 100644 index 541a191c..00000000 --- a/_partials/dotfiles_same_laptop.md +++ /dev/null @@ -1,6 +0,0 @@ -
- - I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI) 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 Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** diff --git a/_partials/es/chrome.md b/_partials/es/chrome.md deleted file mode 100644 index 2487eb77..00000000 --- a/_partials/es/chrome.md +++ /dev/null @@ -1,9 +0,0 @@ -## Chrome - tu navegador - -Instala el navegador Google Chrome si no lo tienes todavía y configúralo como tu __navegador predeterminado__. - -Sigue los pasos en el siguiente enlace :point_right: [Instalación de Google Chrome](https://support.google.com/chrome/answer/95346?co=GENIE.Platform%3DDesktop&hl=en-GB) - -__¿Por qué Chrome?__ - -Lo recomendamos como navegador predeterminado porque es el más compatible con los tests y la ejecución de código. Además trabaja con Google Cloud Platform. Otra opción es Firefox. No recomendamos usar otros navegadores como Opera, Internet Explorer o Safari. diff --git a/_partials/es/dbeaver.md b/_partials/es/dbeaver.md deleted file mode 100644 index f031e088..00000000 --- a/_partials/es/dbeaver.md +++ /dev/null @@ -1,4 +0,0 @@ - -## DBeaver - -DDescarga e instala [DBeaver](https://dbeaver.io/), una herramienta poderosa, gratuita y de código abierto para conectar con cualquier base de datos, explorar su esquema e incluso **hacer consultas SQL**. diff --git a/_partials/es/direnv.md b/_partials/es/direnv.md index 989ab657..ea375034 100644 --- a/_partials/es/direnv.md +++ b/_partials/es/direnv.md @@ -4,7 +4,7 @@ {% if os == "macos" %} ``` bash -brew install direnv +brew install -y direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` {% elsif os == "windows" %} diff --git a/_partials/es/dotfiles.md b/_partials/es/dotfiles.md index f1934de2..8557f4fd 100644 --- a/_partials/es/dotfiles.md +++ b/_partials/es/dotfiles.md @@ -1,20 +1,156 @@ ## Dotfiles -Los hackers aman mejorar sus shells y sus herramientas. Comenzaremos con una configuración por defecto genial proporcionada por [Le Wagon](http://github.com/lewagon/dotfiles) y almacenada en GitHub. +Mejoremos la experiencia de tu máquina instalando los [dotfiles 🔗](https://github.com/lewagon/dotfiles) preconfigurados de Le Wagon. Son archivos de configuración para tu terminal, zsh, git y VS Code. -### Verifica tu configuración de GitHub CLI -Primero, hagamos una verificación rápida. Abre tu terminal y ejecuta el comando siguiente: +### Obtener tu nombre de usuario de GitHub + +Ejecuta el siguiente comando: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -Deberías ver tu usuario GitHub. Si no es así, **no hagas más nada** y pide ayuda. -Parece que hay un problema con el paso anterior (`gh auth`). +✔️ Deberías ver tu nombre de usuario de GitHub en la pantalla. + +❌ Si no es así, detente aquí y pide ayuda. Puede haber un problema con el paso anterior (`gh auth`). + + +### Crear un fork de los dotfiles + +Para personalizar esta configuración, tendrás que crear un **fork** del repositorio en tu propia cuenta de GitHub. + +Crear un **fork** genera una copia del repositorio en tu cuenta (`your_github_username/dotfiles`), que luego podrás modificar con tus datos personales, como tu nombre. + +
+Si ya hiciste otro bootcamp de Le Wagon (Desarrollo web, Desarrollo de software con IA, Análisis de datos, Ciencia de datos e IA), abre un ticket con un TA y abre esta sección para ver las instrucciones ❗ + + +Es posible que tengas una versión antigua de los dotfiles de Le Wagon. Podrían ser incompatibles con la configuración actual. + + +**Junto con un TA**, haz una de las siguientes acciones: + +
+Estoy usando la misma máquina (o una máquina nueva que ya tiene los dotfiles). + +1. Ve a tu carpeta actual de dotfiles: + ```bash + cd ~/code/$GITHUB_USERNAME/dotfiles + ``` + +1. Comprueba las diferencias con la versión actual de los dotfiles de Le Wagon: + ```bash + git diff upstream/master + ``` + +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración. + +
+ +
+Estoy usando una máquina nueva sin los dotfiles. + +1. Ve a GitHub y encuentra tu repositorio de `dotfiles`. + +1. Comprueba cuántos commits por detrás y por delante está de `lewagon/dotfiles:master`. Puedes verlo justo encima de la lista de archivos. + +1. Haz clic en los enlaces de commits por detrás y por delante, y desplázate hacia abajo para ver las diferencias. + +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración. + +
+ +
+El paso anterior mostró diferencias importantes. + +Si estás de acuerdo con perder tus dotfiles actuales (recomendado): + +Ten en cuenta que esto eliminará cualquier cambio personal que hayas hecho en la configuración de tu shell, como cargar utilidades adicionales o cambiar su apariencia. Si no recuerdas haber hecho cambios, no debería haber ningún problema. + +1. Elimina tu repositorio actual de dotfiles en GitHub. +1. Elimina el repositorio local: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continúa con la configuración. + +
+Si no quieres perder tus dotfiles actuales, te recomendamos trabajar con ramas. Haz clic para abrir. + +En tu **portátil**, o donde tengas una copia **local** de **tu versión actual de los dotfiles**. + +1. Haz commit de tu versión actual de los dotfiles: + + ```bash + git add . + git status # Comprueba qué se incluirá en el commit + git commit -m "Version prior to new setup" + ``` + +1. Crea una rama de tu configuración actual de dotfiles y súbela a GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` + +1. Vuelve a `master`: `git checkout master`. + +1. En tu `master` local, ejecuta `git pull upstream master`. + +1. Comprueba que no estés en estado `MERGING`. Si lo estás, resuelve los conflictos. + + Es importante que aceptes los cambios entrantes en los archivos `.zshrc`, `.zprofile` y `settings.json`, especialmente todo lo relacionado con `pyenv` y los entornos de Python. + + Si hay demasiados conflictos, usa tu editor de código para reemplazar el contenido de los archivos en conflicto por el de los [dotfiles de Le Wagon](https://www.github.com/lewagon/dotfiles). + + Haz commit de la resolución de conflictos: `git commit --no-edit` + +1. Sube tus cambios a GitHub: `git push origin master`. + +1. Continúa con la configuración. + +
+ +
+ +
+ +
+ +Es hora de crear un fork del repositorio y clonarlo en tu ordenador: + +```bash +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone +``` + +Si aparece la pregunta _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, escribe `yes` y pulsa `Enter`. + +### Instalar los dotfiles + +Ejecuta el instalador de `dotfiles` con: + +```bash +cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh +``` + +Comprueba los correos electrónicos registrados en tu cuenta de GitHub. Tendrás que elegir uno en el siguiente paso: + +```bash +gh api user/emails | jq -r '.[].email' +``` + +Ejecuta el instalador de git: + +```bash +cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh +``` +:point_up: Se te pedirá tu nombre (`FirstName LastName`) y tu correo electrónico. -### Fork y/o clone los archivos de configuración +:warning: **Debes** introducir uno de los correos que aparecen arriba, obtenidos con el comando `gh api ...`. Si no lo haces, Kitt no podrá realizar un seguimiento de tu progreso. -Hay tres opciones, escoge **una**: +💡 Selecciona la dirección `...@users.noreply.github.com` si no quieres que tu correo aparezca en repositorios públicos a los que contribuyas. diff --git a/_partials/es/dotfiles_installer.md b/_partials/es/dotfiles_installer.md deleted file mode 100644 index d0f96ac3..00000000 --- a/_partials/es/dotfiles_installer.md +++ /dev/null @@ -1,24 +0,0 @@ -### Ejecuta el instalador de dotfiles - -Ejecuta el instalador de `dotfiles`. - -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh -``` - -Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno de ellos en el próximo paso: - -```bash -gh api user/emails | jq -r '.[].email' -``` - -Ejecuta el instalador de git: - -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh -``` - -:point_up: Esto te **guiará** con tu nombre (`FirstName LastName`) y con tu email. -:warning: Cuidado, **debes** poner uno de los emails de la lista de arriba que te suministra el comando `gh api ...` usado anteriormente. Si haces eso, Kitt no podrá hacerle seguimiento a tu progreso. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir. - -Ahora **cierra** todas las ventanas de tu terminal que tengas abiertas por favor. diff --git a/_partials/es/dotfiles_merge_upstream.md b/_partials/es/dotfiles_merge_upstream.md deleted file mode 100644 index 06498340..00000000 --- a/_partials/es/dotfiles_merge_upstream.md +++ /dev/null @@ -1,50 +0,0 @@ -Abre tu terminal y ve a tu proyecto `dotfiles`: - -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` - -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: - -1. Commit la versión actual de tus dotfiles: - ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" - ``` - -1. Trae los cambios del repositorio upstream: `git merge upstream/master` - -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. - -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. - -1. Si todo parece estar en orden, continúa. - -
- ¿Demasiados conflictos? - - - Vamos a tomar la versión actual de `lewagon/dotfiles`. - - Primero aborta la merge: `git merge --abort`. - - Ejecuta `{{ CODE_EDITOR_CMD }} .` - - 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 {{ 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. - -
- -Es hora de guardar tus cambios y subirlos. - -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` - -
diff --git a/_partials/es/dotfiles_new_laptop.md b/_partials/es/dotfiles_new_laptop.md deleted file mode 100644 index 63f43c8b..00000000 --- a/_partials/es/dotfiles_new_laptop.md +++ /dev/null @@ -1,13 +0,0 @@ -
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon pero tengo una nueva laptop - - -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento.Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** - -Es hora de clonarlo el repositorio en tu laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone lewagon/dotfiles -``` diff --git a/_partials/es/dotfiles_new_student.md b/_partials/es/dotfiles_new_student.md deleted file mode 100644 index 2d7e262a..00000000 --- a/_partials/es/dotfiles_new_student.md +++ /dev/null @@ -1,18 +0,0 @@ -
- - No he hecho el bootcamp de Web Development o Data Science & AI de Le Wagon - - - Tu configuración es personal, así que necesitas tu propio repositorio para almacenarla. Primero tienes que hacer el fork del repositorio en tu cuenta GitHub. - -Hacer un fork significa que crearás un nuevo repositorio en tu cuenta GitHub idéntico al original. Tendrás un nuevo repositorio en tu cuenta GitHub, `your_github_username/dotfiles`. El fork es necesario porque cada uno de ustedes necesitará poner información específica (e.g. tu nombre) en esos archivos. - -Ejecutemos este comando para hacer un **fork** del repositorio `lewagon/dotfiles` y clonarlo: - - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
diff --git a/_partials/es/dotfiles_same_laptop.md b/_partials/es/dotfiles_same_laptop.md deleted file mode 100644 index 86785121..00000000 --- a/_partials/es/dotfiles_same_laptop.md +++ /dev/null @@ -1,6 +0,0 @@ -
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon en la misma laptop - - -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento. Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** diff --git a/_partials/es/gcp_account_setup.md b/_partials/es/gcp_account_setup.md new file mode 100644 index 00000000..ce06a1f1 --- /dev/null +++ b/_partials/es/gcp_account_setup.md @@ -0,0 +1,127 @@ + +### Configuración del proyecto + +- Ve a [Google Cloud](https://console.cloud.google.com/) y crea una cuenta si aún no tienes una +- En Cloud Console, en la lista de proyectos, selecciona o crea un proyecto de Cloud + +⚠️ **Importante:** Al crear un proyecto nuevo, verás un campo **Organization**. Déjalo como **"No organization"**. No selecciones ni crees una organización. Elegir una organización aplica restricciones que pueden impedirte utilizar los servicios de Google Cloud durante el bootcamp. + +![](images/gcp-create-project.png) + +- Asígnale un nombre, por ejemplo, `Wagon Bootcamp` +- Observa el `ID` que se crea automáticamente para el proyecto, por ejemplo, `wagon-bootcamp-123456` + +![](images/gcp_project.png) + +ℹ️ Anota el **Project ID** (por ejemplo, `wagon-bootcamp-123456`), que **no** es lo mismo que el nombre del proyecto que elegiste (por ejemplo, `Wagon Bootcamp`). Necesitarás el ID más adelante al ejecutar comandos en la terminal, pero no te preocupes: siempre puedes encontrarlo en Google Cloud. + +### Idioma de la cuenta + +Para facilitar el seguimiento de las instrucciones durante el bootcamp, abre las preferencias de tu cuenta de Google Cloud: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) + +Si el *idioma preferido* no es: + +- **English** +- **United States** + +Entonces cambia el idioma a inglés: + +- Haz clic en el icono del lápiz de edición +- Selecciona **English** +- Selecciona **United States** +- Haz clic en **Select** + +### Cuenta de facturación + +Ahora vincularás tu cuenta a tu tarjeta de crédito. Este paso es obligatorio; de lo contrario, no podrás utilizar los servicios proporcionados por Google Cloud. No te preocupes: podrás utilizar la mayoría de los servicios de Google Cloud mediante créditos gratuitos durante el bootcamp. + +⚠️ En algunos casos, Google puede hacer un cargo en tu tarjeta (de unos 10 €) para verificar que es válida. Desafortunadamente, no se reembolsará una vez aprobada, pero se añadirá como crédito en Google Cloud que podrás utilizar cuando hayas usado o hayan caducado tus créditos gratuitos. + +![](images/gcp-billing.png) + +- Haz clic en **Billing** +- Haz clic en **MANAGE BILLING ACCOUNTS** +- Haz clic en **ADD BILLING ACCOUNT** +- Ponle un nombre a tu cuenta de facturación, por ejemplo, `My Billing Account` +- Haz clic en "I have read..." y acepta las condiciones del servicio +- Haz clic en **CONTINUE** +- Selecciona el tipo de cuenta: `Individual` +- Introduce tu nombre y dirección + +Deberías ver que tienes un crédito gratuito de "$300 credits over the next 90 days". + +- Haz clic en los datos de la tarjeta +- Introduce los datos de tu tarjeta de crédito +- Haz clic en **START MY FREE TRIAL** + +Una vez hecho esto, verifica que tu cuenta de facturación esté vinculada a tu proyecto de Google Cloud. + +- Selecciona tu proyecto +- Ve a **Billing** +- Selecciona **LINK A BILLING ACCOUNT** +- Selecciona `My Billing Account` +- Haz clic en **SET ACCOUNT** + +Ahora deberías ver: + +```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. +``` + +
+ 👉 Si no tienes una tarjeta de crédito 👈 + +Si no tienes una tarjeta de crédito, una alternativa es crear una cuenta de **Revolut**. +Revolut es una aplicación financiera que te permite crear una tarjeta de crédito virtual vinculada a tu cuenta de facturación del teléfono móvil. + +Omite este paso si tienes una tarjeta de crédito y la utilizas para la configuración. + +Descarga la aplicación Revolut o visita [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la aplicación (introduce tu número de teléfono móvil y haz clic en Get Started). + +- Abre la aplicación Revolut +- Introduce tu número de teléfono móvil +- Introduce el código de verificación recibido por SMS +- La aplicación te pedirá tu país, dirección, nombre y apellidos, fecha de nacimiento y dirección de correo electrónico +- La aplicación también te pedirá un selfie y tu profesión +- La aplicación requerirá una foto de tu documento de identidad o pasaporte + +Una vez hecho esto, selecciona el plan estándar (gratuito). No es necesario añadir la tarjeta a Apple Pay, solicitar el envío de una tarjeta física ni añadir dinero. + +Ahora tienes una tarjeta virtual que utilizaremos para configurar Google Cloud. + +En la vista principal de la aplicación Revolut + +- Haz clic en Ready to use +- Haz clic en la tarjeta +- Haz clic en Show card details +- Anota los datos de la tarjeta de crédito virtual y utilízalos para continuar con la configuración de Google Cloud + +
+ +
+ 👉 Si recibes un correo de Google que dice "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 + +Esto puede ocurrir especialmente si acabas de configurar una cuenta de Revolut. + +- Haz clic en PROCEED TO VERIFICATION +- Se te pedirá que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, sin ninguna otra información) +- Si utilizaste **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides eliminar la fecha de caducidad de la captura) +- Explica que estás asistiendo al bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta de Revolut para configurar Google Cloud para el bootcamp mediante una tarjeta de crédito virtual + +Puedes recibir una validación o solicitudes de más información en un plazo de 30 minutos. + +Una vez completada la verificación, deberías recibir un correo que indique: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". + +
+ +### Activación de los servicios de Google Cloud + +- Asegúrate de que la facturación esté activada para tu proyecto de Google Cloud + +ℹ️ Tienes un **crédito de 300 $** para utilizar en recursos de Google Cloud, más que suficiente para el bootcamp. + +- [Activa las API de BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Este paso puede tardar unos minutos) + +¡Eso es todo para la configuración en el navegador! La configuración de la terminal aparece más adelante en esta guía. diff --git a/_partials/es/gcp_account_setup_intro.md b/_partials/es/gcp_account_setup_intro.md new file mode 100644 index 00000000..e95d17b2 --- /dev/null +++ b/_partials/es/gcp_account_setup_intro.md @@ -0,0 +1,5 @@ +## Configuración de Google Cloud Platform + +[Google Cloud](https://cloud.google.com/) es una solución en la nube que utilizarás para desplegar tus productos basados en Machine Learning en producción. + +🚨 Si eres estudiante del **Part-Time Bootcamp**, ¡OMITE ESTA SECCIÓN POR AHORA! **Google Cloud** ofrece 300 $ de crédito gratuito durante 3 meses. No querrás activar tu cuenta de Google Cloud demasiado pronto 🙅‍♂️ diff --git a/_partials/es/gcp_setup.md b/_partials/es/gcp_setup.md index 16ab4058..9c8c1d68 100644 --- a/_partials/es/gcp_setup.md +++ b/_partials/es/gcp_setup.md @@ -1,191 +1,62 @@ -## Configuración de Google Cloud Platform +### Configurar Cloud SDK -[GCP](https://cloud.google.com/) es una solución en la nube que usarás para colocar tus productos basados en Machine Learning en producción. +- Autentica la CLI de `gcloud` con la cuenta de Google que utilizaste para GCP -🚨 Si estás en el grupo de estudiantes del **Bootcamp de Medio Tiempo**, ¡IGNORA ESTA SECCIÓN POR AHORA! **GCP** ofrece $300 en créditos durante 3 meses, así que no es buena idea activar tu cuenta GCP demasiado pronto 🙅‍♂️ + {% if os == "macos" %} + ```bash + gcloud auth login + ``` + {% elsif os == "linux" %} + ```bash + gcloud auth login + ``` + {% elsif os == "windows" %} + ```bash + gcloud auth login --no-launch-browser + ``` + {% endif %} -### Preparación del Proyecto +- Inicia sesión en tu cuenta de Google en la nueva pestaña que se abrió en tu navegador web -- Ve a [Google Cloud](https://console.cloud.google.com/) y crea una cuenta si aún no tienes una -- En la consola de Cloud, en la lista de proyectos, selecciona o crea un proyecto Cloud +- Muestra tu cuenta activa y comprueba que aparece la dirección de correo electrónico que utilizaste para GCP -![](images/gcp-create-project.png) -- Asígnale un nombre como `Wagon Bootcamp` por ejemplo -- ❗ Comprueba que el campo _Location_ esté establecido en _No organization_ ❗ -- Verás que se creará un `ID` automáticamente para el proyecto e. g. `wagon-bootcamp-123456` + ```bash + gcloud auth list + ``` -![](images/gcp_project.png) +- Establece tu proyecto actual (reemplaza `PROJECT_ID` por el `ID` de tu proyecto, por ejemplo, `wagon-bootcamp-123456`) -### Idioma de la cuenta + ```bash + gcloud config set project PROJECT_ID + ``` -Abre las preferencias en tu cuenta GCP para facilitar el seguimiento de las instrucciones durante el bootcamp: +- Muestra tu cuenta activa y tu proyecto actual, y comprueba que aparece tu proyecto -https://myaccount.google.com/language + ```bash + gcloud config list + ``` -Si el *idioma de preferencia* no es: -- **English** -- **United States** +- Ahora vamos a configurar las credenciales predeterminadas de la aplicación para que tu código Python pueda acceder a GCP: -Cámbialo a inglés: -- Haz clic en el logo edición (es una lapicera) -- Selecciona **English** -- Selecciona **United States** -- Haz clic en **Select** + ```bash + gcloud auth application-default login + ``` -### Cuenta de facturación + Esto abrirá una ventana del navegador. Inicia sesión con la misma cuenta de Google que utilizaste para crear tu proyecto de GCP. Tus credenciales se guardarán automáticamente. -Ahora conecta tu cuenta con tu tarjeta de crédito. Este paso es obligatorio para poder usar los servicios que suministra GCP. No te preocupes, podrás utilizar la mayoría de los servicios de GCP por medio de créditos gratuitos durante el bootcamp. +- Verifiquemos que tus credenciales predeterminadas de la aplicación funcionan: -![](images/gcp-billing.png) + ```bash + gcloud auth application-default print-access-token + ``` -- Haz clic en **Billing** -- Haz clic en **MANAGE BILLING ACCOUNTS** -- Haz clic en **ADD BILLING ACCOUNT** -- Asígnale un nombre a tu cuenta de facturación, e. g. `My Billing Account` -- Haz clic en "I have read..." y acepta los términos de uso -- Haz clic en **CONTINUE** -- Selecciona tu tipo de cuenta: `Individual` -- Agrega tu nombre y dirección + Deberías ver una cadena de token larga. Si aparece un error, vuelve a ejecutar `gcloud auth application-default login`. -Verás que tienes créditos gratuitos con un valor de "$300 a utilizar en los próximos 90 días". +
+ Solución de problemas -- Haz clic en los detalles de la tarjeta -- Agrega la información de tu tarjeta de crédito -- Haz clic en **START MY FREE TRIAL**. Esto significa comenzar mi período de prueba. + - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` + - Asegúrate de que la facturación esté habilitada para tu proyecto de Google Cloud Platform [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project) +
-Cuando termines, verifica que la cuenta de facturación esté conectada con tu proyecto GCP. - -- Selecciona tu proyecto -- Ve a **Billing** -- Selecciona **LINK A BILLING ACCOUNT** -- Selecciona `My Billing Account` -- Haz clic en **SET ACCOUNT** - -Ahora deberías ver lo siguiente: - -``` -Free trial status: $300 credit and 91 days remaining - with a full account, you'll get unlimited access to all of Google Cloud Platform. -``` - -Esto significa Estado de período de prueba: crédito de $300 y 91 días para usarlo - con la full account, tendrás acceso ilimitado a todo lo que ofrece Google Cloud Platform. - -
- 👉 Si no tienes una tarjeta de crédito 👈 - - -Si no tienes una tarjeta de crédito, puedes abrir una cuenta en **Revolut**. -Revolut es una aplicación que funciona como un banco y que te permitirá crear una tarjeta de crédito virtual conectada a la dirección de facturación de tu smartphone. - -Ignora este paso si ya tienes una tarjeta de crédito. Simplemente úsala para hacer la configuración. - -Descarga la app Revolut o ve a [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la app (introduce tu número de teléfono móvil y haz clic en Get Started). - -- Abre la app Revolut -- Agrega tu número de teléfono móvil -- Agrega el código de verificación que recibiste por SMS -- La app te preguntará por tu país, dirección, primer y segundo nombre, fecha de nacimiento y el email -- La app también te pedirá tu profesión y una selfie -- La app te pedirá una foto de tu documento nacional de identidad o pasaporte - -Cuando termines, selecciona el plan estándar (gratuito). No tienes que agregar la tarjeta a Apple pay, pedir que te envíen una tarjeta a tu domicilio ni tampoco agregar dinero a la cuenta. - -Ahora tienes una tarjeta virtual que podrás usar para hacer la configuración de GCP. - -En la vista principal de la app Revolut -- Haz clic en Ready to use -- Haz clic en the card -- Haz clic en Show card details -- Toma nota de la información de la tarjeta de crédito virtual y úsala para completar la configuración de GCP - -
- -
- 👉 Si recibes un email de Google diciendo "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 - - -Esto puede pasar justo después de haber creado la cuenta en Revolut. - -- Haz clic en PROCEED TO VERIFICATION -- Te pedirán que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, nada más) -- Si ya has usado **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides quitar la fecha de vencimiento de la captura) -- Explica que estás haciendo el bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta en Revolut para poder configurar GCP para el bootcamp con una tarjeta de crédito virtual - -Es posible que te validen la cuenta pero también es posible que te pidan más información en los próximos 30 minutos. - -Cuando la cuenta sea validada recibirás un email diciendo lo siguiente: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". Esto significa que tu cuenta Google Cloud Platform ha sido restablecida - -
- -### Habilitación de servicios de GCP - -- Asegúrate de que la facturación está habilitada para tu proyecto Google Cloud - -ℹ️ Tienes un **crédito de $300** para usar con recursos de Google Cloud. Esto será más que suficiente para el bootcamp. - -- [Habilita las APIs BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Esto puede tomar varios minutos) - -### Configuración de Cloud sdk - -- Autentica el CLI de `gcloud` con la cuenta que usaste para GCP -```bash -gcloud auth login -``` -- Inicia sesión en tu cuenta Google en la nueva pestaña que se abrió en tu navegador -- Lista la cuenta que tienes activa y verifica que el email que usaste para GCP está ahí -```bash -gcloud auth list -``` -- Define tu proyecto actual (reemplaza `PROJECT_ID` con el `ID` de tu proyecto e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- Lista la cuenta que tienes activa y tu proyecto actual y verifica que tu proyecto está ahí -```bash -gcloud config list -``` - -### Crea una llave 🔑 de cuenta de servicio - -Como ya creaste una cuenta `GCP account` y un `project` (identificado por su `PROJECT_ID`), vamos a configurar las acciones (llamadas API calls) que quieres que tu código ejecute. - -
- 🤔 ¿Por qué necesitamos una clave de cuenta de servicio? - - - Creaste una `cuenta GCP` conectada a una tarjeta de crédito. Te facturarán de acuerdo al uso que les des a los recursos de **Google Cloud Platform**. El cargo se hará si utilizas algo después de que el período de prueba gratuito se haya terminado o si te excedes del límite de consumo que te permite dicho período. - - En tu `cuenta GCP` has creado un solo `proyecto GCP` identificado por su `PROJECT_ID`. Los `proyectos GCP` te permiten organizar y monitorear la manera en que consumes los recursos **GCP** de forma más precisa. En este bootcamp solo crearemos un solo proyecto. - - Ahora necesitamos una manera de saber qué recursos nuestro código podrá consumir dentro de un `GCP project`. Nuestro código consume recursos GCP por medio de llamadas API. - - Ya que las llamadas API no son gratuitas, es importante definir cuidadosamente cómo nuestro código las utilizará. Sin embargo, durante el bootcamp no habrá restricciones. Le permitiremos a nuestro código que utilice todas las API **GCP** sin restricciones. - - Así como pueden haber varios proyectos asociados a una cuenta GCP, un proyecto puede estar compuesto de muchos servicios (cualquier paquete de código, sin importar su formato, que necesite utilizar llamadas a la API de GCP para cumplir con su propósito). - - GCP exige que los servicios de los proyectos que usen llamadas API se registren en la plataforma y que se configuren sus credenciales por medio del acceso concedido a una `service account`. - - Por ahora solo tendremos que usar un solo servicio y crearemos la `service account` correspondiente. -
- -Ya que la [service account](https://cloud.google.com/iam/docs/service-accounts) es lo que identifica tu aplicación (y por ende tu cuenta de facturación GCP y, en última instancia, tu tarjeta de crédito), lo mejor es ser cuidadoso en los próximos pasos. - -⚠️ **No compartas la 🔑 del archivo json de tu cuenta de servicio** ⚠️ No la guardes en tu escritorio ni en tu código base de git (incluso si tu repositorio git es privado). Que no se te olvide en un lugar como la máquina de café y, por supuesto, no la envíes en un tweet. - -- Ve a la [página de las cuentas de servicio](https://console.cloud.google.com/apis/credentials/serviceaccountkey) -- Selecciona tu proyecto en la lista de proyectos recientes si te piden que -- Crees una cuenta de servicio: - - Haz clic en **CREATE SERVICE ACCOUNT** que significa crear une cuenta de servicio: - - Define un `Service account name` para esa cuenta. Esto significa Nombre de cuenta de servicio - - Haz clic en **CREATE AND CONTINUE** que significa crear y continuar - - Haz clic en **Select a role** que significa selecciona un rol. Escoge `Quick access/Basic` luego **Owner**. Esto otorga acceso total a todos los recursos - - Haz clic en **CONTINUE** - - Haz clic en **DONE** -- Descarga la 🔑 del archivo json de la cuenta de servicio: - - Haz clic en la cuenta de servicio recién creada - - Haz clic en **KEYS** - - Haz clic en **ADD KEY** y luego en **Create new key** - - Selecciona **JSON** y haz clic en **CREATE** - -![](images/gcp_create_key.png) - -El navegador acaba de guardar la 🔑 del archivo json de la cuenta de servicio en tu carpeta de descargas (el nombre se le asigna según el nombre de la cuenta de servicio. Es algo como `le-wagon-data-123456789abc.json`) +🏁 ¡Has terminado la configuración de GCP! diff --git a/_partials/es/gcp_setup_end.md b/_partials/es/gcp_setup_end.md deleted file mode 100644 index b4bbd9f3..00000000 --- a/_partials/es/gcp_setup_end.md +++ /dev/null @@ -1,52 +0,0 @@ - -
- ℹ️ ¿Cómo encontrar la ruta absoluta de un archivo? - Puedes arrastrar el archivo a tu terminal. -
- -**Reinicia** tu terminal y ejecuta lo siguiente: - -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` - -Deberías obtener la siguiente información: - -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -Ahora verifica si la ruta al archivo json de tu cuenta de servicio es el correcto: - -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` - -👉 Este comando debería mostrar el contenido del archivo json de tu cuenta de servicio. Si no es el caso, pídele ayuda a un TA 🙏 - -Tu código y utilidades ahora pueden acceder a los recursos de tu cuenta GCP. - -Continuemos con los últimos pasos de la configuración... - -- Lista las cuentas de servicio asociadas a tu cuenta activa y a tu proyecto actual -```bash -gcloud iam service-accounts list -``` -- Recupera el email de la cuenta de servicio e. g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- Lista los roles de la cuenta de servicio desde la cli (reemplaza el PROJECT_ID y el SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- Ahora deberías ver que tu cuenta de servicio tiene el rol de `roles/owner` - -
- Resolución de problemas - -- `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.`. Esto significa que el proyecto a facturar está asociado a una cuenta de facturación que no está habilitada - - Asegúrate de habilitar la facturación para tu proyecto https://cloud.google.com/billing/docs/how-to/modify-project -
- -🏁 Listo. ¡Has terminado la configuración de GCP! diff --git a/_partials/es/gcp_setup_linux.md b/_partials/es/gcp_setup_linux.md deleted file mode 100644 index 4485a20b..00000000 --- a/_partials/es/gcp_setup_linux.md +++ /dev/null @@ -1,11 +0,0 @@ -- Guarda el archivo json de la cuenta de servicio en un lugar que recuerdes. Por ejemplo: - -``` bash -/home/LINUX_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -- Guarda la **ruta absoluta** al archivo `JSON` como una variable de entorno: - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.aliases -``` diff --git a/_partials/es/gcp_setup_mid.md b/_partials/es/gcp_setup_mid.md deleted file mode 100644 index 9763a8aa..00000000 --- a/_partials/es/gcp_setup_mid.md +++ /dev/null @@ -1,20 +0,0 @@ -- Guarda el archivo json de la cuenta de servicio en un lugar que recuerdes. Por ejemplo: - -``` bash -/Users/MACOS_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -- Guarda la **ruta absoluta** al archivo `JSON` como una variable de entorno: - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Nota:** cada vez que ejecutes este comando, agregará esta línea a tu archivo zshrc sin importar si la línea ya existe en el archivo. Si cometiste un error y necesitas arreglarlo, es preferible que abras el archivo y edites la línea! - -Puedes hacerlo ejecutando - -```bash -code ~/.zshrc -``` - -en la Terminal! 😄 diff --git a/_partials/es/gcp_setup_wsl.md b/_partials/es/gcp_setup_wsl.md deleted file mode 100644 index aec8ba41..00000000 --- a/_partials/es/gcp_setup_wsl.md +++ /dev/null @@ -1,67 +0,0 @@ -Ahora vamos a mover el archivo json de la cuenta de servicio desde tu disco en Windows al disco en Ubuntu. Esto le permitirá a las herramientas de desarrollo en Ubuntu acceder a los recursos de tu cuenta GCP. - -Primero crea un directorio para almacenar el archivo. - -👉 Abre una terminal en Ubuntu y ejecuta los siguiente comandos - -🚨 reemplaza el `GITHUB_NICKNAME` por tu nickname de **GitHub** - -``` bash -cd ~/code/GITHUB_NICKNAME -ls -la -``` - -Si el comando no muestra el directorio `dotfiles`, pídele ayuda a un TA 🙏 - -Si no es el caso, puedes proceder con la configuración: - -``` bash -mkdir gcp -``` - -![](images/wsl-gcp-dir.png) - -Ahora moveremos el archivo json de la cuenta de servicio al directorio `gcp` que acabamos de crear. - -Abre un **Buscador de Archivos** de Windows (Win + E) y localiza el directorio `gcp` en el sistema de archivo de Ubuntu. - -Puedes optar por las siguientes alternativas: -- Usar el enlace de **Acceso rápido** que creamos hace un rato -- O escribir la localización del directorio `gcp` manualmente en la barra de direcciones del sistema de archivos de Ubuntu: - -``` -\\wsl$\Ubuntu\home\UBUNTU_USERNAME\code\GITHUB_NICKNAME -``` - - -🚨 Si optas por la segunda opción: -- reemplaza el `UBUNTU_USERNAME` por el usuario que escogiste durante la configuración de **Ubuntu** -- reemplaza el `GITHUB_NICKNAME` por tu nickname de **GitHub** - -![](images/wsl-gcp-key.png) - -Cuando hayas localizado el directorio `gcp` en el **Buscador de Archivos** de Windows, ponle el archivo json de la cuenta de servicio que descargaste. - -Ahora deberías poder ver el archivo desde el sistema de archivos de Ubuntu. - -👉 Abre una terminal en Ubuntu y verifica que el archivo json de la cuenta de servicio ha sido movido - -``` bash -cd gcp -ls -la -``` - -![](images/wsl-gcp-dir-2.png) - -Si no ves el archivo json de la cuenta de servicio en el directorio `gcp`, pídele ayuda a un TA 🙏 - -Ahora almacenaremos la ruta al archivo json de la cuenta de servicio en una variable de entorno. - -🚨 Haz las siguientes sustituciones en este comando: -- El `UBUNTU_USERNAME` por el usuario que escogiste durante la configuración de **Ubuntu** -- El `GITHUB_NICKNAME` por tu nickname de **GitHub** -- El `SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json` por el nombre del archivo json de tu cuenta de servicio. - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/home/UBUNTU_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.aliases -``` diff --git a/_partials/es/homebrew.md b/_partials/es/homebrew.md index c9fe407c..637adf78 100644 --- a/_partials/es/homebrew.md +++ b/_partials/es/homebrew.md @@ -1,69 +1,41 @@ ## Homebrew -### 1. Instálalo: -Si usas Mac tienes que instalar [Homebrew](http://brew.sh/) el cual es un sistema de gestión de paquetes. -Será necesario cuando tengamos que instalar algún programa. -Para instalarlo, abre tu Terminal y ejecuta lo siguiente: + +[Homebrew](http://brew.sh/) es un gestionador de paquetes: es un programa que se usa para instalar otros programas desde la línea de comando. ¡Vamos a instalarlo! + +Abre la terminal y ejecuta lo siguiente: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -Te pedirá tu confirmación (presiona `Enter`) y tu **contraseña de usuario macOS** (la que usas para [iniciar sesión](https://support.apple.com/en-gb/HT202860) cuando reinicias tu Macbook). -:warning: Cuando escribas tu contraseña en la Terminal, **no** la verás (sólo verás algo como `*****`). ¡Esto es **normal**! Simplemente escribe tu contraseña y confirma presionando `Enter`. - -
- 🛠 Si aparece un Error: Not a valid ref: refs/remotes/origin/master - +Te pedirá que confirmes (presionando `Enter`) y también te pedirá la **contraseña de tu cuenta de usuario macOS** (la que usas para [iniciar sesión](https://support.apple.com/en-gb/HT202860) cuando reinicias tu Macbook). -El error completo es el siguiente: +:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar. -``` bash -Error: Not a valid ref: refs/remotes/origin/master : -fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree. -``` - -Ejecuta los siguientes comandos para resolverlo: - -``` bash -rm -fr $(brew --repo homebrew/core) # because you can't `brew untap homebrew/core` -brew tap homebrew/core -``` +Si ya tienes Homebrew instalado, el sistema te lo dirá y puedes continuar. -
- -Si ya tienes Homebrew, el sistema te lo dirá. No hay problema, así que puedes continuar. - -### 2. Asegúrate de tener la versión más reciente: +Una vez que Homebrew haya terminado de instalarse, ejecuta estos dos comandos para agregarlo a tu `PATH`: ```bash -brew update +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$(/opt/homebrew/bin/brew shellenv)" ``` -
- 🛠 Si aparece un error /usr/local must be writable - -Simplemente ejecuta lo siguiente: +Asegúrate de tener la última versión: -``` bash -sudo chown -R $USER:admin /usr/local +```bash brew update ``` -
- -### 3. Luego instala algunos programas útiles: - -Ejecuta lo siguiente en la terminal (puedes copiar / pegar todas las líneas juntas una sola vez). +Luego, instala algunos programas útiles (puedes copiar y pegar todas las líneas de código al mismo tiempo): ```bash -brew upgrade git || brew install git -brew upgrade gh || brew install gh -brew upgrade wget || brew install wget -brew upgrade imagemagick || brew install imagemagick -brew upgrade jq || brew install jq -brew upgrade openssl || brew install openssl -brew upgrade tree || brew install tree -brew upgrade ncdu || brew install ncdu -brew upgrade xz || brew install xz -brew upgrade readline || brew install readline +brew upgrade git || brew install -y git +brew upgrade gh || brew install -y gh +brew upgrade wget || brew install -y wget +brew upgrade imagemagick || brew install -y imagemagick +brew upgrade jq || brew install -y jq +brew upgrade openssl || brew install -y openssl +brew upgrade tree || brew install -y tree +brew upgrade direnv || brew install -y direnv ``` diff --git a/_partials/es/install_python.md b/_partials/es/install_python.md new file mode 100644 index 00000000..3520d8c0 --- /dev/null +++ b/_partials/es/install_python.md @@ -0,0 +1,79 @@ +## Instalar Python y sus dependencias + +Tu sistema operativo - macOS, o Ubuntu (nativo, o dentro de WSL) - viene con un "Python del sistema". Esa es una versión de Python de la que depende tu sistema. No vamos a tocar esa. Vamos a hacer una configuración profesional de Python en la que no estropees tu "Python del sistema" y en la que podrás cambiar la versión que quieras usar para cada proyecto en el que trabajes. + +Para gestionar diferentes versiones de Python y entornos virtuales (descubrirás qué significa eso durante la clase de configuración), usaremos la herramienta de última generación [`uv` creada por Astral](https://docs.astral.sh/uv/). + + +### Instalar `uv` + +Primero, instalaremos `uv`: + +```bash +curl -LsSf https://astral.sh/uv/install.sh | sh +``` + +A continuación, reinicia tu shell ejecutando esto: + +```bash +exec zsh +``` + +### Crear un entorno virtual + +A continuación, crearemos un entorno virtual (un entorno aislado con Python y las dependencias del bootcamp): + +```bash +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 +``` + +Ahora que hemos creado este nuevo entorno virtual, reiniciemos nuestro shell para que lo detecte (esto funciona gracias a los `lewagon/dotfiles` que instalamos antes): + +```bash +exec zsh +``` + +Comprobemos que todo ha ido bien. Ejecuta esto: + +```bash +which python3 +``` + +Debería devolver esto: + +{% if os == "macos" %} +``` bash +/Users/your-username/.lewagon/venvs/lewagon/bin/python3 +``` +{% elsif os == "windows" %} +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 +``` +{% elsif os == "linux" %} +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 +``` +{% endif %} + +Si no lo hace, ¡consulta con un TA! No continúes con el siguiente paso hasta que hayas resuelto esto. + + +### Instalar dependencias + +Python es genial para datos, porque la comunidad ha desarrollado una enorme cantidad de paquetes que podemos reutilizar. + +Instalemos los más comunes: + +{% if os == "macos" %} +``` bash +uv pip install -r {{ SPECS_LOCATION }}/apple_silicon.txt +``` +{% elsif os == "windows" %} +``` bash +uv pip install -r {{ SPECS_LOCATION }}/linux.txt +``` +{% elsif os == "linux" %} +``` bash +uv pip install -r {{ SPECS_LOCATION }}/linux.txt +``` +{% endif %} diff --git a/_partials/es/intro.md b/_partials/es/intro.md index 9d2579b2..ca52178b 100644 --- a/_partials/es/intro.md +++ b/_partials/es/intro.md @@ -1,7 +1,10 @@ -# Instrucciones para la configuración -Aquí abajo encontrarás las instrucciones para configurar tu computadora para [el curso de Data Science de Le Wagon](https://www.lewagon.com/data-science-course/full-time) +# Instrucciones de configuración -Por favor **léelas cuidadosamente y ejecuta todos los comandos en el siguiente orden**. Si tienes algún problema, no dudes en pedirle ayuda a una profesor :raising_hand: +A continuación encontrarás las instrucciones para configurar tu ordenador para el [bootcamp de Data Science & AI de Le Wagon](https://www.lewagon.com/data-science-course). -¡Comencemos! :rocket: +Por favor, **léelas detenidamente y ejecuta todos los comandos en el siguiente orden**. + +Esta configuración no es un ejercicio; su único propósito es preparar tu ordenador de forma estandarizada. No experimentes ni pidas ayuda a un LLM. Si te atascas, simplemente pide ayuda a un profesor :raising_hand: + +Empecemos :rocket: diff --git a/_partials/es/kitt.md b/_partials/es/kitt.md index 17671030..93b7024b 100644 --- a/_partials/es/kitt.md +++ b/_partials/es/kitt.md @@ -1,4 +1,5 @@ - ## Kitt + +## Kitt Deberías haber recibido un correo electrónico de Le Wagon invitándote a registrarte en [Kitt](https://kitt.lewagon.com) (nuestra plataforma de aprendizaje). diff --git a/_partials/es/nbextensions.md b/_partials/es/nbextensions.md index 7f07e8b4..95546933 100644 --- a/_partials/es/nbextensions.md +++ b/_partials/es/nbextensions.md @@ -1,12 +1,22 @@ -## Mejora Jupyter Notebook +## Configuración de Jupyter Notebook -Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. +Dependiendo de tu sistema, necesitamos hacer algunos cambios pequeños en tu configuración de Jupyter. -Ejecuta las siguientes líneas para crear una hoja de estilos `custom.css` en tu directorio de configuración de Jupyter: +Ejecuta esto: ```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` + +
+Si tienes curiosidad sobre lo que sucede aquí, haz clic aquí. + +Este script añade una configuración para mejorar la visualización de los [elementos `details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. + +Si estás usando Windows WSL, también soluciona otros problemas. +{% if os == "windows" %} +- Se asegura de que tu navegador esté configurado correctamente. Ya estaba configurado, pero la configuración de dotfiles lo sobrescribió. +- Soluciona un error conocido en Jupyter Notebook que siempre abre el árbol de directorios, incluso si especificas una ruta de archivo específica. +{% endif %} + +
diff --git a/_partials/es/osx_silicon.md b/_partials/es/osx_silicon.md index f945c12b..a3ad736c 100644 --- a/_partials/es/osx_silicon.md +++ b/_partials/es/osx_silicon.md @@ -1,34 +1,10 @@ -## Chips Apple Silicon +## Verifica tu procesador -Si compraste tu computadora después de finales del 2020, es probable que tenga un nuevo chip Apple Silicon en lugar de un procesador Intel: descubrámoslo. +De acuerdo con nuestros requisitos de computadoras portátiles, esta configuración solo es compatible con arquitecturas de Apple silicon. **La configuración no funciona en computadoras Mac con procesadores Intel.** -Abre una nueva ventana de la tarminal desde Aplicaciones > Utilidades o búscala con [Spotlight](https://support.apple.com/es-es/HT204014): +Si compraste tu Mac después de finales de 2020, es probable que cuente con un chip Apple silicon. -![Abrir Terminal en macOS](images/macos_open_terminal.png) +Para verificar tu procesador, haz clic en el ícono de Apple en la esquina superior izquierda de tu pantalla y selecciona *"Acerca de esta Mac"*. Comprueba el campo *"Chip"* (o *"Procesador"*): -Copia y pega el siguiente comando en la terminal y presiona `Enter` para ejecutarlo. - -``` bash -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)" -``` - -☝️ El resultado del comando debería indicar si tu computadora usa un chip Apple Silicon. - -Si tu computadora usa **Apple Silicon**, expande el siguiente párrafo y ejecútalo. En caso contrario, ignóralo. - -
- 👉  Setup para Apple Silicon 👈 - -Quieres asegurarte que no estás usando Rosetta, que es una forma de usar tu Terminal como si tuvieras una computadora con Intel. - -Abre la app Finder (o búscala con [Spotlight](https://support.apple.com/es-es/HT204014)). - -Ve a Aplicaciones > Utilidades. - -Ubica la app Terminal (selecciónala). - -Presiona `Cmd` + `I` en la app Terminal, luego verifica que la caja "Abrir usando Rosetta" esté **desmarcada**. -En caso de que no veas esta caja, simplemente continúa. -
- -🚨 Ten esto en mente. Deberás recordarlo más adelante en este setup si tu computadora usa un chip Apple Silicon o Intel. +- ✔️ Si aparece *"Apple"*, tu máquina es compatible. +- ❌ Si aparece *"Intel"*, tu Mac no es compatible. No puedes continuar con la configuración; ponte en contacto con el equipo docente. diff --git a/_partials/es/python_checkup.md b/_partials/es/python_checkup.md index 9fe5ab2e..131b17d6 100644 --- a/_partials/es/python_checkup.md +++ b/_partials/es/python_checkup.md @@ -13,18 +13,6 @@ Verifica tu versión de Python con los siguientes comandos: 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 {{ PIP_CHECKER_URL }})" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL {{ PIP_LOADER_URL }})" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -50,6 +38,15 @@ import sys; sys.version Debería mostrar `{{ PYTHON_VERSION }}` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. +En otra celda, ejecuta: + +```python +import pandas as pd +pd.__version___ +``` + +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. + Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. ¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. diff --git a/_partials/es/windows_browser.md b/_partials/es/windows_browser.md index c832acf0..de137659 100644 --- a/_partials/es/windows_browser.md +++ b/_partials/es/windows_browser.md @@ -13,13 +13,3 @@ Reinicia tu terminal: ```bash exec zsh ``` - -Luego asegúrate de que el siguiente comando devuelva "Browser defined 👌": - -```bash -[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌" -``` - -Si no es así, puedes seguir [estas instrucciones](https://github.com/lewagon/setup/blob/master/_partials/es/windows_browser.md) para configurar tu navegador predeterminado manualmente. - -No dudes en **pedirle ayuda a tu profesor**. diff --git a/_partials/gcp_account_setup.md b/_partials/gcp_account_setup.md new file mode 100644 index 00000000..2f4a4754 --- /dev/null +++ b/_partials/gcp_account_setup.md @@ -0,0 +1,127 @@ + +### Project setup + +- Go to [Google Cloud](https://console.cloud.google.com/) and create an account if you do not already have one +- In the Cloud Console, on the project list, select or create a Cloud project + +⚠️ **Important:** When creating a new project, you will see an **Organization** field. Leave this set to **"No organization"**. Do not select or create an organization. Choosing an organization applies restrictions that can prevent you from using Google Cloud services during the bootcamp. + +![](images/gcp-create-project.png) + +- Give it a name such as `Wagon Bootcamp` for example +- Notice the `ID` automatically created for the project, e.g. `wagon-bootcamp-123456` + +![](images/gcp_project.png) + +ℹ️ Note the **Project ID** (e.g. `wagon-bootcamp-123456`) this is **not** the same as the project name you chose (e.g. `Wagon Bootcamp`). You will need the ID later when running terminal commands, but don't worry, you can always find it in Google Cloud. + +### Account language + +In order to facilitate the following of the instructions during the bootcamp, open your Google Cloud account preferences: + +[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** +- Click on **Select** + +### Billing account + +You will now link your account to your credit card. This step is required or you will not be able to use the services provided by Google Cloud. Do not worry, you will be able to consume most Google Cloud services through free credits throughout the bootcamp. + +⚠️ In some cases, Google may charge your card (around €10) to verify that it is valid. This will unfortunately not be refunded once you are approved, but will be added as credit in Google Cloud that you can use once your free credits have been used or expired. + +![](images/gcp-billing.png) + +- Click on **Billing** +- Click on **MANAGE BILLING ACCOUNTS** +- Click on **ADD BILLING ACCOUNT** +- Give a name to your billing account, e.g. `My Billing Account` +- Click on "I have read..." and agree to the terms of service +- Click on **CONTINUE** +- Select your account type: `Individual` +- Fill your name and address + +You should see that you have a free credit of "$300 credits over the next 90 days". + +- Click on card details +- Enter your credit card info +- Click on **START MY FREE TRIAL** + +Once this is done, verify that your billing account is linked to your Google Cloud project. + +- Select your project +- Go to **Billing** +- Select **LINK A BILLING ACCOUNT** +- Select `My Billing Account` +- Click on **SET ACCOUNT** + +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. + +Skip this step if you own a credit card and use your credit card for the setup. + +Download the Revolut app, or go to [revolut](https://www.revolut.com/a-radically-better-account) and follow the steps to download the app (enter your mobile phone number and click on Get Started). + +- Open the Revolut app +- Enter your mobile phone number +- Enter the verification code received by SMS +- The app will ask for your country, address, first and last name, date of birth, email address +- The app will also ask for a selfie and request your profession +- The app will require a photo of your identification card or passport + +Once this is done, select the standard (free) plan. No need to add the card to Apple pay, or ask for a the delivery of a physical card, or add money securely. + +You now have a virtual card which we will use for the Google Cloud setup. + +In the main view of the Revolut app + +- Click on Ready to use +- Click on the card +- Click on Show card details +- Note down the references of the virtual credit card and use them in order to proceed with the Google Cloud setup + +
+ +
+ 👉 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 +- You will be asked to send a picture of your credit card (only the last 4 digits, no other info) +- In case you used **Revolut**, you can send a screenshot of your virtual credit card (do not forget to remove the validity date from the screenshot) +- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup Google Cloud for the bootcamp using a virtual credit card + +You may receive a validation or requests for more information within 30 minutes. + +Once the verification goes through, you should receive an email stating that "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". + +
+ +### Enabling Google Cloud services + +- Make sure that billing is enabled for your Google Cloud project + +ℹ️ You have a **$300 credit** to use for Google Cloud resources, which will be more than enough for the bootcamp. + +- [Enable the BigQuery and Compute Engine APIs](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (This step may take a few minutes) + +That's it for the browser setup! Terminal setup comes later in this guide. diff --git a/_partials/gcp_account_setup_intro.md b/_partials/gcp_account_setup_intro.md new file mode 100644 index 00000000..8a002557 --- /dev/null +++ b/_partials/gcp_account_setup_intro.md @@ -0,0 +1,5 @@ +## Google Cloud Platform setup + +[Google Cloud](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. + +🚨 If you are a student of the **Part-Time Bootcamp or the Flex bootcamp**, SKIP THIS SECTION FOR NOW! **Google Cloud** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your Google Cloud account too soon 🙅‍♂️ diff --git a/_partials/gcp_cli_setup.md b/_partials/gcp_cli_setup.md index d6c567e1..76eef433 100644 --- a/_partials/gcp_cli_setup.md +++ b/_partials/gcp_cli_setup.md @@ -1,10 +1,12 @@ -## `gcloud` CLI +## Google Cloud CLI + +### Install `gcloud` 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: ```bash -brew install --cask google-cloud-sdk +brew install -y --cask google-cloud-sdk ``` Then you can: @@ -13,6 +15,8 @@ Then you can: $(brew --prefix)/share/google-cloud-sdk/install.sh ``` +When asked if you want to make updates, choose `y`. When asked for the path to an rc file, hit `Enter` to accept the default `.zshrc`. +
Getting a no such file or directory error? diff --git a/_partials/gcp_setup.md b/_partials/gcp_setup.md index fb4c6d43..f508a1f0 100644 --- a/_partials/gcp_setup.md +++ b/_partials/gcp_setup.md @@ -1,235 +1,52 @@ -## 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. - -🚨 If you are a student of the **Part-Time Bootcamp**, SKIP THIS SECTION FOR NOW! **GCP** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your GCP account too soon 🙅‍♂️ - -### Project setup - -- Go to [Google Cloud](https://console.cloud.google.com/) and create an account if you do not already have one -- In the Cloud Console, on the project list, select or create a Cloud project - -![](images/gcp-create-project.png) - -- Give it a name such as `Wagon Bootcamp` for example -- ❗ Check that the field _Location_ is set to _No organization_ ❗ -- Notice the `ID` automatically created for the project, e.g. `wagon-bootcamp-123456` - -![](images/gcp_project.png) - -### Account language - -In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: - -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** -- Click on **Select** - -### Billing account - -You will now link your account to your credit card. This step is required or you will not be able to use the services provided by GCP. Do not worry, you will be able to consume most GCP services through free credits throughout the bootcamp. - -![](images/gcp-billing.png) - -- Click on **Billing** -- Click on **MANAGE BILLING ACCOUNTS** -- Click on **ADD BILLING ACCOUNT** -- Give a name to your billing account, e.g. `My Billing Account` -- Click on "I have read..." and agree the to the terms of service -- Click on **CONTINUE** -- Select your account type: `Individual` -- Fill your name and address - -You should see that you have a free credit of "$300 credits over the next 90days". - -- Click on card details -- Enter your credit card info -- Click on **START MY FREE TRIAL** - -Once this is done, verify that your billing account is linked to your GCP project. - -- Select your project -- Go to **Billing** -- Select **LINK A BILLING ACCOUNT** -- Select `My Billing Account` -- Click on **SET ACCOUNT** - -You should now see: - -``` -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. - -Skip this step if you own a credit card and use your credit card for the setup. - -Download the Revolut app, or go to [revolut](https://www.revolut.com/a-radically-better-account) and follow the steps to download the app (enter your mobile phone number and click on Get Started). - -- Open the Revolut app -- Enter your mobile phone number -- Enter the verification code received by SMS -- The app will ask for your country, address, first and last name, date of birth, email address -- The app will also ask for a selfie and request your profession -- The app will require a photo of your identification card or passport - -Once this is done, select the standard (free) plan. No need to add the card to Apple pay, or ask for a the delivery of a physical card, or add money securely. - -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 -- Note down the references of the virtual credit card and use them in order to proceed with the GCP setup - -
- -
- 👉 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 -- You will be asked to send a picture of your credit card (only the last 4 digits, no other info) -- In case you used **Revolut**, you can send a screenshot of your virtual credit card (do not forget to remove the validity date from the screenshot) -- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup GCP for the bootcamp using a virtual credit card - -You may receive a validation or requests for more information within 30 minutes. - -Once the verification goes through, you should receive an email stating that "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". - -
- -### Enabling GCP services - -- Make sure that billing is enabled for your Google Cloud project - -ℹ️ You have a **$300 credit** to use for Google Cloud resources, which will be more than enough for the bootcamp. - -- [Enable the BigQuery and Compute Engine APIs](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (This step may take a few minutes) - -### Configure Cloud sdk +### Configure the Google Cloud CLI - Authenticate the `gcloud` CLI with the google account you used for GCP -{% if os == "macos" %} -```bash -gcloud auth login -``` -{% elsif os == "linux" %} -```bash -gcloud auth login -``` -{% elsif os == "windows" %} -```bash -gcloud auth login --no-launch-browser -``` -{% endif %} + ```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 -```bash -gcloud auth list -``` -- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- List your active account and current project and check your project is present -```bash -gcloud config list -``` - -### Create a service account key 🔑 - -Now that you have created a `GCP account` and a `project` (identified by its `PROJECT_ID`), we are going to configure the actions (API calls) that you want to allow your code to perform. - -
- 🤔 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 resources 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. - - 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. - - 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. - - In the same way that there may be several projects associated with a GCP account, a project may be composed of several services (any bundle of code, whatever its form factor, that requires the usage of GCP API calls in order to fulfill its purpose). - - GCP requires that the services of the projects using API calls are registered on the platform and their credentials configured through the access granted to a `service account`. - For the moment we will only need to use a single service and will create the corresponding `service account`. -
- -Since the [service account](https://cloud.google.com/iam/docs/service-accounts) is what identifies your application (and therefore your GCP billing account and ultimately your credit card), you are going to want to be cautious with the next steps. - -⚠️ **Do not share you service account json file 🔑** ⚠️ Do not store it on your desktop, do not store it in your git codebase (even if your git repository is private), do not let it by the coffee machine, do not send it as a tweet. - -#### Go to the Service Accounts page - -Navigate to the GCP service accounts page at [this link](https://console.cloud.google.com/apis/credentials/serviceaccountkey). - -- Select your project in the list of recent projects if asked to. -- If not asked, make sure the right project is selected in the Project selecter list at the top of the page. - -An alternate way to navigate to the Service Accounts page is from the following: - -01 Go to Service Accounts - -#### Create a service account - -- Click on **CREATE SERVICE ACCOUNT**. - - 02 Create Service Account - -- Give your service account a name, an id and a description, and click on **CREATE AND CONTINUE**. - - 03 Name the service account - -- Click on **Select a role** and choose `Basic` then **`Owner`**, which gives the service account full access to all resources of your GCP project. - - 04 Add BigQuery Job User - -- Click on the blue **DONE** button at the bottom of this window. We don't need to worry about the section *Grant your users access to this service account*. +- List your active account and check your email address you used for GCP is present - 04 Done + ```bash + gcloud auth list + ``` +- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -#### Create a json key 🔑 for this service account + ```bash + gcloud config set project PROJECT_ID + ``` -- On the service accounts page, click on the email address of the newly created service account. +- List your active account and current project and check your project is present - 05 Select the service account + ```bash + gcloud config list + ``` -- Click on the **KEYS** tab at the top of the page. +- Now let's set up Application Default Credentials so your Python code can access GCP: - 06 Go to Keys + ```bash + gcloud auth application-default login + ``` + This will open a browser window. Log in with the same Google account you used to create your GCP project. Your credentials will be saved automatically. -- Click on **ADD KEY** then **Create new key**. +- Let's verify your Application Default Credentials are working: - 07 Add Key + ```bash + gcloud auth application-default print-access-token + ``` + You should see a long token string. If you see an error, run `gcloud auth application-default login` again. -- Select **JSON** and click on **CREATE**. +
+ Troubleshooting - 08 Choose JSON and Create + - `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](https://cloud.google.com/billing/docs/how-to/modify-project) +
-- 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`). +🏁 You are done with the GCP setup! diff --git a/_partials/gcp_setup_end.md b/_partials/gcp_setup_end.md deleted file mode 100644 index 90d3e122..00000000 --- a/_partials/gcp_setup_end.md +++ /dev/null @@ -1,52 +0,0 @@ - -
- ℹ️ How to find the absolute path of a file? - You can drag and drop the file in your terminal. -
- -**Restart** your terminal and run: - -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` - -The ouptut should be the following: - -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -Now let's verify that the path to your service account json file is correct: - -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` - -👉 This command should display the content of your service account json file. If it does not, ask for a TA 🙏 - -Your code and utilities are now able to access the resources of your GCP account. - -Let's proceed with the final steps of configuration... - -- List the service accounts associated to your active account and current project -```bash -gcloud iam service-accounts list -``` -- Retrieve the service account email address, e.g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- List the roles of the service account from the cli (replace PROJECT_ID and SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- You should see that your service account has a role of `roles/owner` - -
- 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 -
- -🏁 You are done with the GCP setup! diff --git a/_partials/gcp_setup_linux.md b/_partials/gcp_setup_linux.md deleted file mode 100644 index 18ed7cd5..00000000 --- a/_partials/gcp_setup_linux.md +++ /dev/null @@ -1,20 +0,0 @@ -- Store the service account json file somewhere you'll remember, for example: - -``` bash -/home/LINUX_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -- Store the **absolute path** to the `JSON` file as an environment variable: - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line! - -You can do so by running - -```bash -code ~/.zshrc -``` - -in the Terminal! 😄 diff --git a/_partials/gcp_setup_mid.md b/_partials/gcp_setup_mid.md deleted file mode 100644 index 033d65e9..00000000 --- a/_partials/gcp_setup_mid.md +++ /dev/null @@ -1,20 +0,0 @@ -- Store the service account json file somewhere you'll remember, for example: - -``` bash -/Users/MACOS_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -- Store the **absolute path** to the `JSON` file as an environment variable: - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line! - -You can do so by running - -```bash -code ~/.zshrc -``` - -in the Terminal! 😄 diff --git a/_partials/gcp_setup_wsl.md b/_partials/gcp_setup_wsl.md deleted file mode 100644 index 7323eff4..00000000 --- a/_partials/gcp_setup_wsl.md +++ /dev/null @@ -1,76 +0,0 @@ -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. - -👉 Open an Ubuntu terminal and run the following commands - -🚨 replace `GITHUB_NICKNAME` by your **GitHub** nickname - -``` bash -cd ~/code/GITHUB_NICKNAME -ls -la -``` - -If the command does not show the `dotfiles` directory, ask for a TA 🙏 - -Otherwise, you can proceed with the setup: - -``` bash -mkdir gcp -``` - -![](images/wsl-gcp-dir.png) - -We will now move the service account json file to the `gcp` directory we just created. - -Open a Windows **File Explorer** (Win + E) and locate the `gcp` directory in the Ubuntu file system. - -You can either: -- Use the **Quick access** link that we created earlier -- manually type the location of the `gcp` directory in the Ubuntu file system in the address bar: - -``` -\\wsl$\Ubuntu\home\UBUNTU_USERNAME\code\GITHUB_NICKNAME -``` - - -🚨 if you opt for the second option: -- replace `UBUNTU_USERNAME` by the username that you choose during the **Ubuntu** setup -- replace `GITHUB_NICKNAME` by your **GitHub** nickname - -![](images/wsl-gcp-key.png) - -Once you have located the `gcp` directory in the Windows **File Explorer**, move the service account json file that you downloaded inside of it. - -The file should now be visible from Ubuntu file system. - -👉 Open an Ubuntu terminal and verify that the service account json file has been moved - -``` bash -cd gcp -ls -la -``` - -![](images/wsl-gcp-dir-2.png) - -If you do not see the service account json file listed in the `gcp` directory, ask for a TA 🙏 - -We will now store the path to your service account json file in an environment variable. - -🚨 in the following command, replace: -- `UBUNTU_USERNAME` by the username that you choose during the **Ubuntu** setup -- `GITHUB_NICKNAME` by your **GitHub** nickname -- `SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json` by the name of your service account json file - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/home/UBUNTU_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line! - -You can do so by running - -```bash -code ~/.zshrc -``` - -in the Terminal! 😄 diff --git a/_partials/homebrew.md b/_partials/homebrew.md index ef99abf6..3a70d697 100644 --- a/_partials/homebrew.md +++ b/_partials/homebrew.md @@ -1,69 +1,41 @@ ## Homebrew -### 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. -To do so, open your Terminal and run: + +[Homebrew](http://brew.sh/) is a package manager: it's a software used to install other software from the command line. Let's install it! + +Open a terminal and run: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` This will ask for your confirmation (hit `Enter`) and your **macOS user account password** (the one you use to [log in](https://support.apple.com/en-gb/HT202860) when you reboot your Macbook). -:warning: When typing a password in the Terminal, you will **not** get a visual feedback (something like `*****`), this is **normal**!! Type the password and confirm by typing `Enter`. - -
- 🛠 If you get a Error: Not a valid ref: refs/remotes/origin/master error - -The full error would be: - -``` bash -Error: Not a valid ref: refs/remotes/origin/master : -fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree. -``` - -Run the following commands to solve it: - -``` bash -rm -fr $(brew --repo homebrew/core) # because you can't `brew untap homebrew/core` -brew tap homebrew/core -``` - -
+: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`. If you already have Homebrew, it will tell you so, that's fine, go on. -### 2. Make sure you are on the latest version: +Once Homebrew has finished installing, run these two commands to add it to your `PATH`: ```bash -brew update +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$(/opt/homebrew/bin/brew shellenv)" ``` -
- 🛠 If you get a /usr/local must be writable error - -Just run this: +Make sure you're on the latest version: -``` bash -sudo chown -R $USER:admin /usr/local +```bash brew update ``` -
- -### 3. Then install some useful software: - -Proceed running the following in the terminal (you can copy / paste all the lines at once). +Then install some useful software (you can copy / paste all the lines at once): ```bash -brew upgrade git || brew install git -brew upgrade gh || brew install gh -brew upgrade wget || brew install wget -brew upgrade imagemagick || brew install imagemagick -brew upgrade jq || brew install jq -brew upgrade openssl || brew install openssl -brew upgrade tree || brew install tree -brew upgrade ncdu || brew install ncdu -brew upgrade xz || brew install xz -brew upgrade readline || brew install readline +brew upgrade git || brew install -y git +brew upgrade gh || brew install -y gh +brew upgrade wget || brew install -y wget +brew upgrade imagemagick || brew install -y imagemagick +brew upgrade jq || brew install -y jq +brew upgrade openssl || brew install -y openssl +brew upgrade tree || brew install -y tree +brew upgrade direnv || brew install -y direnv ``` diff --git a/_partials/install_python.md b/_partials/install_python.md new file mode 100644 index 00000000..f3903331 --- /dev/null +++ b/_partials/install_python.md @@ -0,0 +1,79 @@ +## Install Python and dependencies + +Your operating system - macOS, or Ubuntu (native, or inside WSL) - comes with a "system Python". That's a Python version your system depends on. We don't mess around with that one. We're going to do a professional setup of Python where you don't mess up your "system Python" and where you'll be able to switch which version you want to use for each project you work on. + +To manage different Python versions and virtual environments (you'll discover what that means during the setup lecture), we will use the state-of-the-art [`uv` created by Astral](https://docs.astral.sh/uv/). + + +### Install `uv` + +First, we'll install `uv`: + +```bash +curl -LsSf https://astral.sh/uv/install.sh | sh +``` + +Next, restart your shell by running this: + +```bash +exec zsh +``` + +### Create a virtual environment + +Next, we'll create a virtual environment (an isolated environment with Python and the dependencies for the bootcamp): + +```bash +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 +``` + +Now that we created this new virtual environment, let's restart our shell to pick it up (this works thanks to the `lewagon/dotfiles` we installed before): + +```bash +exec zsh +``` + +Let's check that everything went right. Run this: + +```bash +which python3 +``` + +It should return this: + +{% if os == "macos" %} +``` bash +/Users/your-username/.lewagon/venvs/lewagon/bin/python3 +``` +{% elsif os == "windows" %} +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 +``` +{% elsif os == "linux" %} +``` bash +/home/your-username/.lewagon/venvs/lewagon/bin/python3 +``` +{% endif %} + +If it doesn't, check with a TA! Do not continue with the next step before you solved this! + + +### Install dependencies + +Python is great for data, because the community has developed an enormous amount of packages we can re-use. + +Let's install the most common ones: + +{% if os == "macos" %} +``` bash +uv pip install -r {{ SPECS_LOCATION }}/apple_silicon.txt +``` +{% elsif os == "windows" %} +``` bash +uv pip install -r {{ SPECS_LOCATION }}/linux.txt +``` +{% elsif os == "linux" %} +``` bash +uv pip install -r {{ SPECS_LOCATION }}/linux.txt +``` +{% endif %} diff --git a/_partials/intro.md b/_partials/intro.md index b2b71d22..860d15b0 100644 --- a/_partials/intro.md +++ b/_partials/intro.md @@ -1,8 +1,10 @@ # Setup instructions -You will find below the instructions to set up you computer for [Le Wagon Data Science course](https://www.lewagon.com/data-science-course/full-time) +Below are the instructions for setting up your computer for the [Le Wagon Data Science & AI bootcamp](https://www.lewagon.com/data-science-course). -Please **read them carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand: +Please **read them carefully and execute all commands in the following order**. + +This setup is not an exercise; its sole purpose is to prepare your machine in a standardised way. Do not experiment or ask an LLM for help. If you get stuck, simply ask a teacher for help :raising_hand: Let's start :rocket: diff --git a/_partials/kitt.md b/_partials/kitt.md index 39a45ec8..77b4feac 100644 --- a/_partials/kitt.md +++ b/_partials/kitt.md @@ -1,4 +1,5 @@ - ## 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). diff --git a/_partials/nbextensions.md b/_partials/nbextensions.md index 25dad5ab..273408dc 100644 --- a/_partials/nbextensions.md +++ b/_partials/nbextensions.md @@ -1,12 +1,22 @@ ## 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. +Depending on your system, we need to make some small changes to your Jupyter configuration. -Run the following lines to create a `custom.css` stylesheet in your Jupyter config directory: +Run this: ```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` + +
+If you are curious about what happens here, click here. + +This script adds a configuration to improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. + +If you're using Windows WSL, it also fixes some other problems. +{% if os == "windows" %} +- It makes sure your browser is configured correctly. It was configured before, but was overwritten by the dotfiles setup. +- It fixes a known bug with Jupyter Notebook always opening the directory tree, even if you specify a specific file path. +{% endif %} + +
diff --git a/_partials/osx_python.md b/_partials/osx_python.md index 17af7b48..9274c367 100644 --- a/_partials/osx_python.md +++ b/_partials/osx_python.md @@ -1,25 +1,5 @@ ### Install pre-requisites -Before installing Python, please check your `xz` version with: - -```bash -brew info xz -``` - -It should be more than `5.2.0`, **if not** you should run: - -```bash -sudo rm -rf /usr/local/opt/xz -brew upgrade -brew install xz -``` - -Then run: - -```bash -brew install readline -``` - ### Install `pyenv` macOS 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 Science 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. diff --git a/_partials/osx_silicon.md b/_partials/osx_silicon.md index ab3ce039..c89a1ae6 100644 --- a/_partials/osx_silicon.md +++ b/_partials/osx_silicon.md @@ -1,34 +1,10 @@ -## Apple Silicon Chips +## Check your processor -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. +In line with our laptop requirements, this setup only supports Apple silicon architectures. **The setup does not work on Macs with Intel processors.** -Open a new terminal window from Applications > Utilities or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014): +If you purchased your Mac after late 2020, it likely features an Apple silicon chip. -![Open Terminal on macOS](images/macos_open_terminal.png) +To verify your processor, click the Apple icon in the top-left corner of your screen and select *"About This Mac"*. Check the *"Chip"* (or *"Processor"*) field: -Copy-paste the following command in the terminal and hit `Enter` to execute. - -``` bash -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)" -``` - -☝️ The result of the command should indicate whether your computer uses Apple Silicon. - -If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it. - -
- 👉  Setup for Apple Silicon 👈 - -You want to make sure that you are **not using** Rosetta, which is a way to use your Terminal as if you had an Intel computer. - -Open the Finder app (or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014)). - -Go to Applications > Utilities. - -Locate the Terminal app (select it). - -Press `Cmd` + `I` on the Terminal app, then verify that the box "Open using Rosetta" is **unchecked**. -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 +- ✔️ If it lists *"Apple"*, your machine is compatible. +- ❌ If it says *"Intel"*, your Mac is not supported. You cannot continue the setup, contact the teaching crew. diff --git a/_partials/pip.md b/_partials/pip.md index 090cb7a1..1152a048 100644 --- a/_partials/pip.md +++ b/_partials/pip.md @@ -11,25 +11,9 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: {% if os == "macos" %} -If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it. - -
- 👉  Setup for Apple Silicon 👈 - ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_silicon.txt ``` -
- -If your computer uses **Apple Intel**, expand the paragraph below and go through it. Otherwise ignore it. - -
- 👉  Setup for Apple Intel 👈 - -``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.txt -``` -
{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt diff --git a/_partials/python_checkup.md b/_partials/python_checkup.md index fd8439c3..f40da31e 100644 --- a/_partials/python_checkup.md +++ b/_partials/python_checkup.md @@ -1,6 +1,6 @@ ## Python setup check -### Python and packages check +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -8,42 +8,17 @@ Let's reset your terminal: cd ~/code && exec zsh ``` -Check your Python version with the following commands: -```bash -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 {{ PIP_CHECKER_URL }})" -``` - -Now run the following command to check if you can load these packages: -```bash -python -c "$(curl -fsSL {{ PIP_LOADER_URL }})" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -61,8 +36,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -74,12 +47,22 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` It should output `{{ PYTHON_VERSION }}` followed by some more details. If not, check with a TA. +In another cell, run: + +```python +import pandas as pd +pd.__version__ +``` + +This might take a few minutes to run. It should output a version number, `2.2.3`. 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/ubuntu_gcloud.md b/_partials/ubuntu_gcloud.md index 2ac45086..5310a5cd 100644 --- a/_partials/ubuntu_gcloud.md +++ b/_partials/ubuntu_gcloud.md @@ -1,5 +1,8 @@ + ## Google Cloud CLI +### Install `gcloud` + Install the `gcloud` CLI to communicate with [Google Cloud Platform](https://cloud.google.com/) through your terminal: ```bash sudo apt-get update && sudo apt-get install ca-certificates gnupg curl diff --git a/_partials/windows_browser.md b/_partials/windows_browser.md index 339bcf6d..d332fdcb 100644 --- a/_partials/windows_browser.md +++ b/_partials/windows_browser.md @@ -13,13 +13,3 @@ Reset your terminal: ```bash exec zsh ``` - -Then please make sure that the following command returns "Browser defined 👌": - -```bash -[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌" -``` - -If it does not, you can follow [these instructions](https://github.com/lewagon/setup/blob/master/_partials/windows_browser.md) to set your default browser manually. - -Do not hesitate to **contact a teacher**. diff --git a/builds/LINUX.yml b/builds/LINUX.yml index 6c7cc11f..9e4285a1 100644 --- a/builds/LINUX.yml +++ b/builds/LINUX.yml @@ -9,28 +9,17 @@ partials: - setup/vscode_aifeatures - 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 + - direnv + - install_python - nbextensions - python_checkup - - dbeaver - ubuntu_docker + - gcp_account_setup_intro + - gcp_account_setup + - ubuntu_gcloud - gcp_setup - - gcp_setup_linux - - gcp_setup_end - kitt - setup/ubuntu_slack - setup/slack_settings diff --git a/builds/REMOTE_SETUP.yml b/builds/REMOTE_SETUP.yml index 66cfe41f..bb19902e 100644 --- a/builds/REMOTE_SETUP.yml +++ b/builds/REMOTE_SETUP.yml @@ -26,12 +26,6 @@ partials: # - 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 @@ -39,7 +33,6 @@ partials: - pip - nbextensions - python_checkup - - dbeaver - ubuntu_docker # - de_setup/gcp_setup # - kitt diff --git a/builds/VM.yml b/builds/VM.yml index 5b836065..41cb1111 100644 --- a/builds/VM.yml +++ b/builds/VM.yml @@ -22,12 +22,6 @@ partials: - 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 @@ -35,7 +29,6 @@ partials: - pip - nbextensions - python_checkup - - dbeaver - ubuntu_docker - kitt - setup/windows_slack diff --git a/builds/WINDOWS.yml b/builds/WINDOWS.yml index 48867b25..71eafbcf 100644 --- a/builds/WINDOWS.yml +++ b/builds/WINDOWS.yml @@ -15,32 +15,19 @@ partials: - 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 + - direnv + - install_python - nbextensions - - win_jupyter - python_checkup - - dbeaver - - setup/windows_settings - - win_vs_redistributable - win_docker + - gcp_account_setup_intro + - gcp_account_setup + - ubuntu_gcloud - gcp_setup - - gcp_setup_wsl - - gcp_setup_end - kitt - setup/windows_slack - setup/slack_settings + - setup/windows_settings - kata diff --git a/builds/macOS.yml b/builds/macOS.yml index 535fd42a..4bb9eee5 100644 --- a/builds/macOS.yml +++ b/builds/macOS.yml @@ -11,27 +11,17 @@ partials: - vscode_extensions - setup/vscode_aifeatures - 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 + - direnv + - install_python - nbextensions - python_checkup - - dbeaver - docker + - gcp_account_setup_intro + - gcp_account_setup - gcp_cli_setup - gcp_setup - - gcp_setup_mid - - gcp_setup_end - kitt - setup/macos_slack - setup/slack_settings diff --git a/constants/constants.yml b/constants/constants.yml index fc248190..603c6d42 100644 --- a/constants/constants.yml +++ b/constants/constants.yml @@ -5,3 +5,4 @@ PIP_CHECKER_URL: "https://raw.githubusercontent.com/lewagon/data-setup/master/ch PIP_LOADER_URL: "https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py" CODE_EDITOR: "VS Code" CODE_EDITOR_CMD: "code" +SPECS_LOCATION: "https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases" diff --git a/macOS.es.md b/macOS.es.md index f8c6a27f..77164b76 100644 --- a/macOS.es.md +++ b/macOS.es.md @@ -1,10 +1,13 @@ -# Instrucciones para la configuración -Aquí abajo encontrarás las instrucciones para configurar tu computadora para [el curso de Data Science de Le Wagon](https://www.lewagon.com/data-science-course/full-time) +# Instrucciones de configuración -Por favor **léelas cuidadosamente y ejecuta todos los comandos en el siguiente orden**. Si tienes algún problema, no dudes en pedirle ayuda a una profesor :raising_hand: +A continuación encontrarás las instrucciones para configurar tu ordenador para el [bootcamp de Data Science & AI de Le Wagon](https://www.lewagon.com/data-science-course). -¡Comencemos! :rocket: +Por favor, **léelas detenidamente y ejecuta todos los comandos en el siguiente orden**. + +Esta configuración no es un ejercicio; su único propósito es preparar tu ordenador de forma estandarizada. No experimentes ni pidas ayuda a un LLM. Si te atascas, simplemente pide ayuda a un profesor :raising_hand: + +Empecemos :rocket: ## Cuenta GitHub @@ -18,40 +21,16 @@ Por favor **léelas cuidadosamente y ejecuta todos los comandos en el siguiente :point_right: **[Habilita la Autenticación de Dos Factores (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 te enviará mensajes de texto con un código cuando intentes iniciar sesión. Esto es importante para la seguridad y también pronto será necesario para contribuir código en GitHub. -## Chips Apple Silicon - -Si compraste tu computadora después de finales del 2020, es probable que tenga un nuevo chip Apple Silicon en lugar de un procesador Intel: descubrámoslo. +## Verifica tu procesador -Abre una nueva ventana de la tarminal desde Aplicaciones > Utilidades o búscala con [Spotlight](https://support.apple.com/es-es/HT204014): +De acuerdo con nuestros requisitos de computadoras portátiles, esta configuración solo es compatible con arquitecturas de Apple silicon. **La configuración no funciona en computadoras Mac con procesadores Intel.** -![Abrir Terminal en macOS](images/macos_open_terminal.png) +Si compraste tu Mac después de finales de 2020, es probable que cuente con un chip Apple silicon. -Copia y pega el siguiente comando en la terminal y presiona `Enter` para ejecutarlo. +Para verificar tu procesador, haz clic en el ícono de Apple en la esquina superior izquierda de tu pantalla y selecciona *"Acerca de esta Mac"*. Comprueba el campo *"Chip"* (o *"Procesador"*): -``` bash -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)" -``` - -☝️ El resultado del comando debería indicar si tu computadora usa un chip Apple Silicon. - -Si tu computadora usa **Apple Silicon**, expande el siguiente párrafo y ejecútalo. En caso contrario, ignóralo. - -
- 👉  Setup para Apple Silicon 👈 - -Quieres asegurarte que no estás usando Rosetta, que es una forma de usar tu Terminal como si tuvieras una computadora con Intel. - -Abre la app Finder (o búscala con [Spotlight](https://support.apple.com/es-es/HT204014)). - -Ve a Aplicaciones > Utilidades. - -Ubica la app Terminal (selecciónala). - -Presiona `Cmd` + `I` en la app Terminal, luego verifica que la caja "Abrir usando Rosetta" esté **desmarcada**. -En caso de que no veas esta caja, simplemente continúa. -
- -🚨 Ten esto en mente. Deberás recordarlo más adelante en este setup si tu computadora usa un chip Apple Silicon o Intel. +- ✔️ Si aparece *"Apple"*, tu máquina es compatible. +- ❌ Si aparece *"Intel"*, tu Mac no es compatible. No puedes continuar con la configuración; ponte en contacto con el equipo docente. ## Cómo cerrar aplicaciones en una Mac correctamente @@ -95,73 +74,45 @@ Cuando termines eso, puedes intentar hacer la instalación nuevamente. ## Homebrew -### 1. Instálalo: -Si usas Mac tienes que instalar [Homebrew](http://brew.sh/) el cual es un sistema de gestión de paquetes. -Será necesario cuando tengamos que instalar algún programa. -Para instalarlo, abre tu Terminal y ejecuta lo siguiente: - -```bash -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -``` -Te pedirá tu confirmación (presiona `Enter`) y tu **contraseña de usuario macOS** (la que usas para [iniciar sesión](https://support.apple.com/en-gb/HT202860) cuando reinicias tu Macbook). -:warning: Cuando escribas tu contraseña en la Terminal, **no** la verás (sólo verás algo como `*****`). ¡Esto es **normal**! Simplemente escribe tu contraseña y confirma presionando `Enter`. - -
- 🛠 Si aparece un Error: Not a valid ref: refs/remotes/origin/master +[Homebrew](http://brew.sh/) es un gestionador de paquetes: es un programa que se usa para instalar otros programas desde la línea de comando. ¡Vamos a instalarlo! +Abre la terminal y ejecuta lo siguiente: -El error completo es el siguiente: - -``` bash -Error: Not a valid ref: refs/remotes/origin/master : -fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree. +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -Ejecuta los siguientes comandos para resolverlo: +Te pedirá que confirmes (presionando `Enter`) y también te pedirá la **contraseña de tu cuenta de usuario macOS** (la que usas para [iniciar sesión](https://support.apple.com/en-gb/HT202860) cuando reinicias tu Macbook). -``` bash -rm -fr $(brew --repo homebrew/core) # because you can't `brew untap homebrew/core` -brew tap homebrew/core -``` - -
+:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar. -Si ya tienes Homebrew, el sistema te lo dirá. No hay problema, así que puedes continuar. +Si ya tienes Homebrew instalado, el sistema te lo dirá y puedes continuar. -### 2. Asegúrate de tener la versión más reciente: +Una vez que Homebrew haya terminado de instalarse, ejecuta estos dos comandos para agregarlo a tu `PATH`: ```bash -brew update +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$(/opt/homebrew/bin/brew shellenv)" ``` -
- 🛠 Si aparece un error /usr/local must be writable - -Simplemente ejecuta lo siguiente: +Asegúrate de tener la última versión: -``` bash -sudo chown -R $USER:admin /usr/local +```bash brew update ``` -
- -### 3. Luego instala algunos programas útiles: - -Ejecuta lo siguiente en la terminal (puedes copiar / pegar todas las líneas juntas una sola vez). +Luego, instala algunos programas útiles (puedes copiar y pegar todas las líneas de código al mismo tiempo): ```bash -brew upgrade git || brew install git -brew upgrade gh || brew install gh -brew upgrade wget || brew install wget -brew upgrade imagemagick || brew install imagemagick -brew upgrade jq || brew install jq -brew upgrade openssl || brew install openssl -brew upgrade tree || brew install tree -brew upgrade ncdu || brew install ncdu -brew upgrade xz || brew install xz -brew upgrade readline || brew install readline +brew upgrade git || brew install -y git +brew upgrade gh || brew install -y gh +brew upgrade wget || brew install -y wget +brew upgrade imagemagick || brew install -y imagemagick +brew upgrade jq || brew install -y jq +brew upgrade openssl || brew install -y openssl +brew upgrade tree || brew install -y tree +brew upgrade direnv || brew install -y direnv ``` @@ -226,7 +177,7 @@ Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento En **VS Code**: -1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS). +1. Abramos la "Paleta de comandos" de VS Code: escribe `Cmd-Shift-P`. 1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción. @@ -256,18 +207,6 @@ Cuando termines, tu terminal debería lucir así: :x: Si no, por favor **pídele ayuda a un profesor**. -## direnv - -[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. - - -``` bash -brew install direnv -echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc -``` - - - ## GitHub CLI CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando. @@ -324,182 +263,144 @@ gh auth status ## Dotfiles -Los hackers aman mejorar sus shells y sus herramientas. Comenzaremos con una configuración por defecto genial proporcionada por [Le Wagon](http://github.com/lewagon/dotfiles) y almacenada en GitHub. +Mejoremos la experiencia de tu máquina instalando los [dotfiles 🔗](https://github.com/lewagon/dotfiles) preconfigurados de Le Wagon. Son archivos de configuración para tu terminal, zsh, git y VS Code. -### Verifica tu configuración de GitHub CLI -Primero, hagamos una verificación rápida. Abre tu terminal y ejecuta el comando siguiente: +### Obtener tu nombre de usuario de GitHub + +Ejecuta el siguiente comando: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -Deberías ver tu usuario GitHub. Si no es así, **no hagas más nada** y pide ayuda. -Parece que hay un problema con el paso anterior (`gh auth`). +✔️ Deberías ver tu nombre de usuario de GitHub en la pantalla. +❌ Si no es así, detente aquí y pide ayuda. Puede haber un problema con el paso anterior (`gh auth`). -### Fork y/o clone los archivos de configuración -Hay tres opciones, escoge **una**: +### Crear un fork de los dotfiles +Para personalizar esta configuración, tendrás que crear un **fork** del repositorio en tu propia cuenta de GitHub. -
- - No he hecho el bootcamp de Web Development o Data Science & AI de Le Wagon - - - Tu configuración es personal, así que necesitas tu propio repositorio para almacenarla. Primero tienes que hacer el fork del repositorio en tu cuenta GitHub. - -Hacer un fork significa que crearás un nuevo repositorio en tu cuenta GitHub idéntico al original. Tendrás un nuevo repositorio en tu cuenta GitHub, `your_github_username/dotfiles`. El fork es necesario porque cada uno de ustedes necesitará poner información específica (e.g. tu nombre) en esos archivos. - -Ejecutemos este comando para hacer un **fork** del repositorio `lewagon/dotfiles` y clonarlo: - - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
- +Crear un **fork** genera una copia del repositorio en tu cuenta (`your_github_username/dotfiles`), que luego podrás modificar con tus datos personales, como tu nombre.
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon pero tengo una nueva laptop - +Si ya hiciste otro bootcamp de Le Wagon (Desarrollo web, Desarrollo de software con IA, Análisis de datos, Ciencia de datos e IA), abre un ticket con un TA y abre esta sección para ver las instrucciones ❗ + -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento.Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** +Es posible que tengas una versión antigua de los dotfiles de Le Wagon. Podrían ser incompatibles con la configuración actual. -Es hora de clonarlo el repositorio en tu laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone lewagon/dotfiles -``` +**Junto con un TA**, haz una de las siguientes acciones: -Abre tu terminal y ve a tu proyecto `dotfiles`: - -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` - -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +
+Estoy usando la misma máquina (o una máquina nueva que ya tiene los dotfiles). -1. Commit la versión actual de tus dotfiles: +1. Ve a tu carpeta actual de dotfiles: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Trae los cambios del repositorio upstream: `git merge upstream/master` +1. Comprueba las diferencias con la versión actual de los dotfiles de Le Wagon: + ```bash + git diff upstream/master + ``` -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración. -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. - -1. Si todo parece estar en orden, continúa. +
- ¿Demasiados conflictos? - - - Vamos a tomar la versión actual de `lewagon/dotfiles`. - - Primero aborta la merge: `git merge --abort`. +Estoy usando una máquina nueva sin los dotfiles. - Ejecuta `code .` +1. Ve a GitHub y encuentra tu repositorio de `dotfiles`. - En VS Code, 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. +1. Comprueba cuántos commits por detrás y por delante está de `lewagon/dotfiles:master`. Puedes verlo justo encima de la lista de archivos. - Aún en VS Code, 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. +1. Haz clic en los enlaces de commits por detrás y por delante, y desplázate hacia abajo para ver las diferencias. - Regresa a la terminal y ejecuta un `git diff` y verifica que esto no haya eliminado ninguna configuración personal que quisieras conservar. +Si no hay diferencias importantes aparte de tu nombre y correo electrónico, continúa con la configuración.
-Es hora de guardar tus cambios y subirlos. - -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` - -
- -
- - Ya hice el bootcamp de Web Development o Data Science & AI de Le Wagon en la misma laptop - +El paso anterior mostró diferencias importantes. -Esto significa que ya has hecho el fork del repositorio GitHub lewagon/dotfiles pero tal vez la configuración para el nuevo bootcamp de Data Science & AI no estaba lista en ese momento. Actualicémoslo. **Pide a un TA que te acompañe en los siguientes pasos.** +Si estás de acuerdo con perder tus dotfiles actuales (recomendado): +Ten en cuenta que esto eliminará cualquier cambio personal que hayas hecho en la configuración de tu shell, como cargar utilidades adicionales o cambiar su apariencia. Si no recuerdas haber hecho cambios, no debería haber ningún problema. -Abre tu terminal y ve a tu proyecto `dotfiles`: +1. Elimina tu repositorio actual de dotfiles en GitHub. +1. Elimina el repositorio local: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continúa con la configuración. -```bash -cd ~/code/$GITHUB_USERNAME$/dotfiles -``` +
+Si no quieres perder tus dotfiles actuales, te recomendamos trabajar con ramas. Haz clic para abrir. -Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: +En tu **portátil**, o donde tengas una copia **local** de **tu versión actual de los dotfiles**. -1. Commit la versión actual de tus dotfiles: - ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" - ``` +1. Haz commit de tu versión actual de los dotfiles: -1. Trae los cambios del repositorio upstream: `git merge upstream/master` + ```bash + git add . + git status # Comprueba qué se incluirá en el commit + git commit -m "Version prior to new setup" + ``` -1. Verifica que no estés en estado MERGING. Si lo estás, resuelve los conflictos. +1. Crea una rama de tu configuración actual de dotfiles y súbela a GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Haz un `git diff HEAD~1 HEAD` para revisar qué cambió. +1. Vuelve a `master`: `git checkout master`. -1. Si todo parece estar en orden, continúa. +1. En tu `master` local, ejecuta `git pull upstream master`. -
- ¿Demasiados conflictos? - +1. Comprueba que no estés en estado `MERGING`. Si lo estás, resuelve los conflictos. + + Es importante que aceptes los cambios entrantes en los archivos `.zshrc`, `.zprofile` y `settings.json`, especialmente todo lo relacionado con `pyenv` y los entornos de Python. - Vamos a tomar la versión actual de `lewagon/dotfiles`. + Si hay demasiados conflictos, usa tu editor de código para reemplazar el contenido de los archivos en conflicto por el de los [dotfiles de Le Wagon](https://www.github.com/lewagon/dotfiles). - Primero aborta la merge: `git merge --abort`. + Haz commit de la resolución de conflictos: `git commit --no-edit` - Ejecuta `code .` +1. Sube tus cambios a GitHub: `git push origin master`. - En VS Code, 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. +1. Continúa con la configuración. - Aún en VS Code, 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. +
-Es hora de guardar tus cambios y subirlos. +
+ +Es hora de crear un fork del repositorio y clonarlo en tu ordenador: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` -
- +Si aparece la pregunta _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, escribe `yes` y pulsa `Enter`. -### Ejecuta el instalador de dotfiles +### Instalar los dotfiles -Ejecuta el instalador de `dotfiles`. +Ejecuta el instalador de `dotfiles` con: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno de ellos en el próximo paso: +Comprueba los correos electrónicos registrados en tu cuenta de GitHub. Tendrás que elegir uno en el siguiente paso: ```bash gh api user/emails | jq -r '.[].email' @@ -511,215 +412,111 @@ Ejecuta el instalador de git: cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` -:point_up: Esto te **guiará** con tu nombre (`FirstName LastName`) y con tu email. -:warning: Cuidado, **debes** poner uno de los emails de la lista de arriba que te suministra el comando `gh api ...` usado anteriormente. Si haces eso, Kitt no podrá hacerle seguimiento a tu progreso. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir. - -Ahora **cierra** todas las ventanas de tu terminal que tengas abiertas por favor. - - -## Instalando Python (con [`pyenv`](https://github.com/pyenv/pyenv)) +:point_up: Se te pedirá tu nombre (`FirstName LastName`) y tu correo electrónico. -### Desinstalar `conda` +:warning: **Debes** introducir uno de los correos que aparecen arriba, obtenidos con el comando `gh api ...`. Si no lo haces, Kitt no podrá realizar un seguimiento de tu progreso. -Como estamos utilizando `pyenv` para instalar y gestionar la versión de Python, necesitamos desinstalar [`conda`](https://docs.conda.io/projects/conda/en/latest/), otro gestor de paquetes que podrías tener en tu computadora si previamente instalaste [Anaconda](https://www.anaconda.com/). De esta forma, evitaremos problemas con Python más adelante. +💡 Selecciona la dirección `...@users.noreply.github.com` si no quieres que tu correo aparezca en repositorios públicos a los que contribuyas. -Chequea si tienes `conda` instalado en tu computadora: -```bash -conda list -``` +## direnv -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**. +[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. -
- Instrucciones de desinstalación conda - -- Instala el paquete Anaconda-Clean desde tu terminal y comienza la limpieza -```bash -conda install anaconda-clean -anaconda-clean --yes +``` bash +brew install -y direnv +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -- Remueve todos los directorios de Anaconda -```bash -rm -rf ~/anaconda2 -rm -rf ~/anaconda3 -rm -rf ~/.anaconda_backup - -rm -rf ~/opt -``` -- 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 - - Guarda el archivo con `CMD` + `s` -- Reinicia la terminal con `exec zsh` -- Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - - Abre el archivo con `code ~/.zshrc` - - Remueve las líneas de código desde `>>> conda initialize >>>` hasta `<<< conda initialize <<<` -
+## Instalar Python y sus dependencias +Tu sistema operativo - macOS, o Ubuntu (nativo, o dentro de WSL) - viene con un "Python del sistema". Esa es una versión de Python de la que depende tu sistema. No vamos a tocar esa. Vamos a hacer una configuración profesional de Python en la que no estropees tu "Python del sistema" y en la que podrás cambiar la versión que quieras usar para cada proyecto en el que trabajes. -### Instalar pre-requisitos +Para gestionar diferentes versiones de Python y entornos virtuales (descubrirás qué significa eso durante la clase de configuración), usaremos la herramienta de última generación [`uv` creada por Astral](https://docs.astral.sh/uv/). -Antes de instalar Python, por favor verifica la versión de tu extensión `xz` con: -```bash -brew info xz -``` +### Instalar `uv` -Debe ser superior a `5.2.0`. **Si no es el caso**, debes ejecutar lo siguiente: +Primero, instalaremos `uv`: ```bash -sudo rm -rf /usr/local/opt/xz -brew upgrade -brew install xz +curl -LsSf https://astral.sh/uv/install.sh | sh ``` -Luego ejecuta: +A continuación, reinicia tu shell ejecutando esto: ```bash -brew install readline -``` - -### Instala `pyenv` - -macOS viene con una versión vieja de Python que no queremos usar. Tal vez ya hayas instalado Anaconda u otro programa para utilizar Python y paquetes de Ciencia de Datos. Si es así, no pasa nada ya que haremos una configuración profesional de Python que te permitirá cambiar de versión cuando quieras al escribir `python` en la terminal. - -Primero instala `pyenv` con el siguiente comando en la Terminal: - -```bash -brew install pyenv exec zsh ``` -### Instala Python +### Crear un entorno virtual -Instala la [última versión estable de Python](https://www.python.org/doc/versions/) aceptada en el currículum de Le Wagon: +A continuación, crearemos un entorno virtual (un entorno aislado con Python y las dependencias del bootcamp): ```bash -pyenv install 3.12.9 -``` - -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! - -
- 🛠 Resolución de problemas - -Si aparece un error durante la instalación de Python con `pyenv` y relacionada con `zlib`: - -```txt -zipimport.ZipImportError: can't decompress data; zlib not available +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 ``` -Instala `zlib` con lo siguiente: +Ahora que hemos creado este nuevo entorno virtual, reiniciemos nuestro shell para que lo detecte (esto funciona gracias a los `lewagon/dotfiles` que instalamos antes): ```bash -brew install zlib -export LDFLAGS="-L/usr/local/opt/zlib/lib" -export CPPFLAGS="-I/usr/local/opt/zlib/include" +exec zsh ``` -Luego trata de instalar Python nuevamente: +Comprobemos que todo ha ido bien. Ejecuta esto: ```bash -pyenv install 3.12.9 +which python3 ``` -Es posible que aparezca otro error relacionado con `bzip2`. Esto lo puedes ignorar y continuar al paso siguiente. - -
-
+Debería devolver esto: -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 3.12.9 -exec zsh +``` bash +/Users/your-username/.lewagon/venvs/lewagon/bin/python3 ``` -Para verificar si esto ha funcionado, ejecuta `python --version`. Si ves `3.12.9`, ¡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). - -## Entorno Virtual de Python +Si no lo hace, ¡consulta con un TA! No continúes con el siguiente paso hasta que hayas resuelto esto. -Antes de instalar paquetes de Python, aislaremos la configuración del Bootcamp en un entorno virtual **dedicado**. Usaremos un plugin `pyenv` llamado [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv). -### Instala un virtualenv +### Instalar dependencias -Primero instala este plugin: +Python es genial para datos, porque la comunidad ha desarrollado una enorme cantidad de paquetes que podemos reutilizar. -```bash -git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv -exec zsh -``` - -Crea el entorno virtual que usaremos durante todo el bootcamp: - -```bash -pyenv virtualenv 3.12.9 lewagon -``` +Instalemos los más comunes: -Define el entorno virtual con lo siguiente: -```bash -pyenv global lewagon +``` bash +uv pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_silicon.txt ``` -¡Genial! Ahora cada vez que queramos instalar un paquete Python, lo haremos en ese entorno. -### Paquetes de Python +## Configuración de Jupyter Notebook -Ahora que tenemos el ambiente virtual de `lewagon` adecuado, es hora de instalarle algunos paquetes. +Dependiendo de tu sistema, necesitamos hacer algunos cambios pequeños en tu configuración de Jupyter. -Primero, actualiza `pip`, la herramienta para instalar Paquetes Python desde [pypi.org](https://pypi.org). Ejecuta lo siguiente en la última terminal donde esté activado el virtualenv de `lewagon`: +Ejecuta esto: ```bash -pip install --upgrade pip +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` -Ahora instala algunos paquetes para las primeras semanas del programa: - - -Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo. -
- 👉  Configuración para Apple Silicon 👈 +Si tienes curiosidad sobre lo que sucede aquí, haz clic aquí. -``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_silicon.txt -``` -
+Este script añade una configuración para mejorar la visualización de los [elementos `details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. -Si tu computadora usa **Apple Intel**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo. +Si estás usando Windows WSL, también soluciona otros problemas. -
- 👉  Configuración para Apple Intel 👈 -``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.txt -```
- -## Mejora Jupyter Notebook - -Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. - -Ejecuta las siguientes líneas para crear una hoja de estilos `custom.css` en tu directorio de configuración de Jupyter: - -```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css -``` - - ## Chequeo de la configuración de Python ### Chequeo de Python y packages @@ -735,18 +532,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -772,15 +557,18 @@ import sys; sys.version Debería mostrar `3.12.9` 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`. - -¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. +En otra celda, ejecuta: +```python +import pandas as pd +pd.__version___ +``` +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. -## DBeaver +Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. -DDescarga e instala [DBeaver](https://dbeaver.io/), una herramienta poderosa, gratuita y de código abierto para conectar con cualquier base de datos, explorar su esquema e incluso **hacer consultas SQL**. +¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. ## Docker 🐋 @@ -808,91 +596,72 @@ Deberías obtener lo siguiente: ![](images/docker_info.png) +## Configuración de Google Cloud Platform -## CLI de `gcloud` - -Antes de configurar nuestra cuenta Google Cloud Platform vamos a configurar el CLI de `gcloud` (una interfaz de línea de comando para Google Cloud Platform). Ejecuta el siguiente código y sigue las indicaciones de la terminal para actualizar tu $PATH y habilitar la finalización del comando del shell para el archivo `.zshrc`: - -```bash -brew install --cask google-cloud-sdk -``` - -Luego podrás ejecutar lo siguiente: - -```bash -$(brew --prefix)/share/google-cloud-sdk/install.sh -``` - -
- ¿Recibes un error no such file or directory? - - Prueba esto: - -```bash -$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/install.sh -``` - -Si eso no funciona, contacta a un TA. - -
- +[Google Cloud](https://cloud.google.com/) es una solución en la nube que utilizarás para desplegar tus productos basados en Machine Learning en producción. -## Configuración de Google Cloud Platform +🚨 Si eres estudiante del **Part-Time Bootcamp**, ¡OMITE ESTA SECCIÓN POR AHORA! **Google Cloud** ofrece 300 $ de crédito gratuito durante 3 meses. No querrás activar tu cuenta de Google Cloud demasiado pronto 🙅‍♂️ -[GCP](https://cloud.google.com/) es una solución en la nube que usarás para colocar tus productos basados en Machine Learning en producción. -🚨 Si estás en el grupo de estudiantes del **Bootcamp de Medio Tiempo**, ¡IGNORA ESTA SECCIÓN POR AHORA! **GCP** ofrece $300 en créditos durante 3 meses, así que no es buena idea activar tu cuenta GCP demasiado pronto 🙅‍♂️ -### Preparación del Proyecto +### Configuración del proyecto - Ve a [Google Cloud](https://console.cloud.google.com/) y crea una cuenta si aún no tienes una -- En la consola de Cloud, en la lista de proyectos, selecciona o crea un proyecto Cloud +- En Cloud Console, en la lista de proyectos, selecciona o crea un proyecto de Cloud + +⚠️ **Importante:** Al crear un proyecto nuevo, verás un campo **Organization**. Déjalo como **"No organization"**. No selecciones ni crees una organización. Elegir una organización aplica restricciones que pueden impedirte utilizar los servicios de Google Cloud durante el bootcamp. ![](images/gcp-create-project.png) -- Asígnale un nombre como `Wagon Bootcamp` por ejemplo -- ❗ Comprueba que el campo _Location_ esté establecido en _No organization_ ❗ -- Verás que se creará un `ID` automáticamente para el proyecto e. g. `wagon-bootcamp-123456` + +- Asígnale un nombre, por ejemplo, `Wagon Bootcamp` +- Observa el `ID` que se crea automáticamente para el proyecto, por ejemplo, `wagon-bootcamp-123456` ![](images/gcp_project.png) +ℹ️ Anota el **Project ID** (por ejemplo, `wagon-bootcamp-123456`), que **no** es lo mismo que el nombre del proyecto que elegiste (por ejemplo, `Wagon Bootcamp`). Necesitarás el ID más adelante al ejecutar comandos en la terminal, pero no te preocupes: siempre puedes encontrarlo en Google Cloud. + ### Idioma de la cuenta -Abre las preferencias en tu cuenta GCP para facilitar el seguimiento de las instrucciones durante el bootcamp: +Para facilitar el seguimiento de las instrucciones durante el bootcamp, abre las preferencias de tu cuenta de Google Cloud: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) -https://myaccount.google.com/language +Si el *idioma preferido* no es: -Si el *idioma de preferencia* no es: - **English** - **United States** -Cámbialo a inglés: -- Haz clic en el logo edición (es una lapicera) +Entonces cambia el idioma a inglés: + +- Haz clic en el icono del lápiz de edición - Selecciona **English** - Selecciona **United States** - Haz clic en **Select** ### Cuenta de facturación -Ahora conecta tu cuenta con tu tarjeta de crédito. Este paso es obligatorio para poder usar los servicios que suministra GCP. No te preocupes, podrás utilizar la mayoría de los servicios de GCP por medio de créditos gratuitos durante el bootcamp. +Ahora vincularás tu cuenta a tu tarjeta de crédito. Este paso es obligatorio; de lo contrario, no podrás utilizar los servicios proporcionados por Google Cloud. No te preocupes: podrás utilizar la mayoría de los servicios de Google Cloud mediante créditos gratuitos durante el bootcamp. + +⚠️ En algunos casos, Google puede hacer un cargo en tu tarjeta (de unos 10 €) para verificar que es válida. Desafortunadamente, no se reembolsará una vez aprobada, pero se añadirá como crédito en Google Cloud que podrás utilizar cuando hayas usado o hayan caducado tus créditos gratuitos. ![](images/gcp-billing.png) - Haz clic en **Billing** - Haz clic en **MANAGE BILLING ACCOUNTS** - Haz clic en **ADD BILLING ACCOUNT** -- Asígnale un nombre a tu cuenta de facturación, e. g. `My Billing Account` -- Haz clic en "I have read..." y acepta los términos de uso +- Ponle un nombre a tu cuenta de facturación, por ejemplo, `My Billing Account` +- Haz clic en "I have read..." y acepta las condiciones del servicio - Haz clic en **CONTINUE** -- Selecciona tu tipo de cuenta: `Individual` -- Agrega tu nombre y dirección +- Selecciona el tipo de cuenta: `Individual` +- Introduce tu nombre y dirección -Verás que tienes créditos gratuitos con un valor de "$300 a utilizar en los próximos 90 días". +Deberías ver que tienes un crédito gratuito de "$300 credits over the next 90 days". -- Haz clic en los detalles de la tarjeta -- Agrega la información de tu tarjeta de crédito -- Haz clic en **START MY FREE TRIAL**. Esto significa comenzar mi período de prueba. +- Haz clic en los datos de la tarjeta +- Introduce los datos de tu tarjeta de crédito +- Haz clic en **START MY FREE TRIAL** -Cuando termines, verifica que la cuenta de facturación esté conectada con tu proyecto GCP. +Una vez hecho esto, verifica que tu cuenta de facturación esté vinculada a tu proyecto de Google Cloud. - Selecciona tu proyecto - Ve a **Billing** @@ -900,213 +669,156 @@ Cuando termines, verifica que la cuenta de facturación esté conectada con tu p - Selecciona `My Billing Account` - Haz clic en **SET ACCOUNT** -Ahora deberías ver lo siguiente: +Ahora deberías ver: -``` +```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. ``` -Esto significa Estado de período de prueba: crédito de $300 y 91 días para usarlo - con la full account, tendrás acceso ilimitado a todo lo que ofrece Google Cloud Platform. -
👉 Si no tienes una tarjeta de crédito 👈 +Si no tienes una tarjeta de crédito, una alternativa es crear una cuenta de **Revolut**. +Revolut es una aplicación financiera que te permite crear una tarjeta de crédito virtual vinculada a tu cuenta de facturación del teléfono móvil. -Si no tienes una tarjeta de crédito, puedes abrir una cuenta en **Revolut**. -Revolut es una aplicación que funciona como un banco y que te permitirá crear una tarjeta de crédito virtual conectada a la dirección de facturación de tu smartphone. +Omite este paso si tienes una tarjeta de crédito y la utilizas para la configuración. -Ignora este paso si ya tienes una tarjeta de crédito. Simplemente úsala para hacer la configuración. +Descarga la aplicación Revolut o visita [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la aplicación (introduce tu número de teléfono móvil y haz clic en Get Started). -Descarga la app Revolut o ve a [revolut](https://www.revolut.com/a-radically-better-account) y sigue los pasos para descargar la app (introduce tu número de teléfono móvil y haz clic en Get Started). +- Abre la aplicación Revolut +- Introduce tu número de teléfono móvil +- Introduce el código de verificación recibido por SMS +- La aplicación te pedirá tu país, dirección, nombre y apellidos, fecha de nacimiento y dirección de correo electrónico +- La aplicación también te pedirá un selfie y tu profesión +- La aplicación requerirá una foto de tu documento de identidad o pasaporte -- Abre la app Revolut -- Agrega tu número de teléfono móvil -- Agrega el código de verificación que recibiste por SMS -- La app te preguntará por tu país, dirección, primer y segundo nombre, fecha de nacimiento y el email -- La app también te pedirá tu profesión y una selfie -- La app te pedirá una foto de tu documento nacional de identidad o pasaporte +Una vez hecho esto, selecciona el plan estándar (gratuito). No es necesario añadir la tarjeta a Apple Pay, solicitar el envío de una tarjeta física ni añadir dinero. -Cuando termines, selecciona el plan estándar (gratuito). No tienes que agregar la tarjeta a Apple pay, pedir que te envíen una tarjeta a tu domicilio ni tampoco agregar dinero a la cuenta. +Ahora tienes una tarjeta virtual que utilizaremos para configurar Google Cloud. -Ahora tienes una tarjeta virtual que podrás usar para hacer la configuración de GCP. +En la vista principal de la aplicación Revolut -En la vista principal de la app Revolut - Haz clic en Ready to use -- Haz clic en the card +- Haz clic en la tarjeta - Haz clic en Show card details -- Toma nota de la información de la tarjeta de crédito virtual y úsala para completar la configuración de GCP +- Anota los datos de la tarjeta de crédito virtual y utilízalos para continuar con la configuración de Google Cloud
- 👉 Si recibes un email de Google diciendo "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 - + 👉 Si recibes un correo de Google que dice "Urgent: your billing account XXXXXX-XXXXXX-XXXXXX has been suspended" 👈 -Esto puede pasar justo después de haber creado la cuenta en Revolut. +Esto puede ocurrir especialmente si acabas de configurar una cuenta de Revolut. - Haz clic en PROCEED TO VERIFICATION -- Te pedirán que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, nada más) -- Si ya has usado **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides quitar la fecha de vencimiento de la captura) -- Explica que estás haciendo el bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta en Revolut para poder configurar GCP para el bootcamp con una tarjeta de crédito virtual +- Se te pedirá que envíes una foto de tu tarjeta de crédito (solo los últimos 4 dígitos, sin ninguna otra información) +- Si utilizaste **Revolut**, puedes enviar una captura de pantalla de tu tarjeta de crédito virtual (no olvides eliminar la fecha de caducidad de la captura) +- Explica que estás asistiendo al bootcamp de Le Wagon, que no tienes una tarjeta de crédito y que acabas de crear una cuenta de Revolut para configurar Google Cloud para el bootcamp mediante una tarjeta de crédito virtual -Es posible que te validen la cuenta pero también es posible que te pidan más información en los próximos 30 minutos. +Puedes recibir una validación o solicitudes de más información en un plazo de 30 minutos. -Cuando la cuenta sea validada recibirás un email diciendo lo siguiente: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.". Esto significa que tu cuenta Google Cloud Platform ha sido restablecida +Una vez completada la verificación, deberías recibir un correo que indique: "Your Google Cloud Platform billing account XXXXXX-XXXXXX-XXXXXX has been fully reinstated and is ready to use.".
-### Habilitación de servicios de GCP +### Activación de los servicios de Google Cloud -- Asegúrate de que la facturación está habilitada para tu proyecto Google Cloud +- Asegúrate de que la facturación esté activada para tu proyecto de Google Cloud -ℹ️ Tienes un **crédito de $300** para usar con recursos de Google Cloud. Esto será más que suficiente para el bootcamp. +ℹ️ Tienes un **crédito de 300 $** para utilizar en recursos de Google Cloud, más que suficiente para el bootcamp. -- [Habilita las APIs BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Esto puede tomar varios minutos) +- [Activa las API de BigQuery y Compute Engine](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (Este paso puede tardar unos minutos) -### Configuración de Cloud sdk +¡Eso es todo para la configuración en el navegador! La configuración de la terminal aparece más adelante en esta guía. -- Autentica el CLI de `gcloud` con la cuenta que usaste para GCP -```bash -gcloud auth login -``` -- Inicia sesión en tu cuenta Google en la nueva pestaña que se abrió en tu navegador -- Lista la cuenta que tienes activa y verifica que el email que usaste para GCP está ahí -```bash -gcloud auth list -``` -- Define tu proyecto actual (reemplaza `PROJECT_ID` con el `ID` de tu proyecto e.g. `wagon-bootcamp-123456`) -```bash -gcloud config set project PROJECT_ID -``` -- Lista la cuenta que tienes activa y tu proyecto actual y verifica que tu proyecto está ahí -```bash -gcloud config list -``` -### Crea una llave 🔑 de cuenta de servicio -Como ya creaste una cuenta `GCP account` y un `project` (identificado por su `PROJECT_ID`), vamos a configurar las acciones (llamadas API calls) que quieres que tu código ejecute. +## CLI de `gcloud` -
- 🤔 ¿Por qué necesitamos una clave de cuenta de servicio? +Antes de configurar nuestra cuenta Google Cloud Platform vamos a configurar el CLI de `gcloud` (una interfaz de línea de comando para Google Cloud Platform). Ejecuta el siguiente código y sigue las indicaciones de la terminal para actualizar tu $PATH y habilitar la finalización del comando del shell para el archivo `.zshrc`: +```bash +brew install --cask google-cloud-sdk +``` - Creaste una `cuenta GCP` conectada a una tarjeta de crédito. Te facturarán de acuerdo al uso que les des a los recursos de **Google Cloud Platform**. El cargo se hará si utilizas algo después de que el período de prueba gratuito se haya terminado o si te excedes del límite de consumo que te permite dicho período. +Luego podrás ejecutar lo siguiente: - En tu `cuenta GCP` has creado un solo `proyecto GCP` identificado por su `PROJECT_ID`. Los `proyectos GCP` te permiten organizar y monitorear la manera en que consumes los recursos **GCP** de forma más precisa. En este bootcamp solo crearemos un solo proyecto. +```bash +$(brew --prefix)/share/google-cloud-sdk/install.sh +``` - Ahora necesitamos una manera de saber qué recursos nuestro código podrá consumir dentro de un `GCP project`. Nuestro código consume recursos GCP por medio de llamadas API. +
+ ¿Recibes un error no such file or directory? - Ya que las llamadas API no son gratuitas, es importante definir cuidadosamente cómo nuestro código las utilizará. Sin embargo, durante el bootcamp no habrá restricciones. Le permitiremos a nuestro código que utilice todas las API **GCP** sin restricciones. + Prueba esto: - Así como pueden haber varios proyectos asociados a una cuenta GCP, un proyecto puede estar compuesto de muchos servicios (cualquier paquete de código, sin importar su formato, que necesite utilizar llamadas a la API de GCP para cumplir con su propósito). +```bash +$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/install.sh +``` - GCP exige que los servicios de los proyectos que usen llamadas API se registren en la plataforma y que se configuren sus credenciales por medio del acceso concedido a una `service account`. +Si eso no funciona, contacta a un TA. - Por ahora solo tendremos que usar un solo servicio y crearemos la `service account` correspondiente.
-Ya que la [service account](https://cloud.google.com/iam/docs/service-accounts) es lo que identifica tu aplicación (y por ende tu cuenta de facturación GCP y, en última instancia, tu tarjeta de crédito), lo mejor es ser cuidadoso en los próximos pasos. -⚠️ **No compartas la 🔑 del archivo json de tu cuenta de servicio** ⚠️ No la guardes en tu escritorio ni en tu código base de git (incluso si tu repositorio git es privado). Que no se te olvide en un lugar como la máquina de café y, por supuesto, no la envíes en un tweet. +### Configurar Cloud SDK -- Ve a la [página de las cuentas de servicio](https://console.cloud.google.com/apis/credentials/serviceaccountkey) -- Selecciona tu proyecto en la lista de proyectos recientes si te piden que -- Crees una cuenta de servicio: - - Haz clic en **CREATE SERVICE ACCOUNT** que significa crear une cuenta de servicio: - - Define un `Service account name` para esa cuenta. Esto significa Nombre de cuenta de servicio - - Haz clic en **CREATE AND CONTINUE** que significa crear y continuar - - Haz clic en **Select a role** que significa selecciona un rol. Escoge `Quick access/Basic` luego **Owner**. Esto otorga acceso total a todos los recursos - - Haz clic en **CONTINUE** - - Haz clic en **DONE** -- Descarga la 🔑 del archivo json de la cuenta de servicio: - - Haz clic en la cuenta de servicio recién creada - - Haz clic en **KEYS** - - Haz clic en **ADD KEY** y luego en **Create new key** - - Selecciona **JSON** y haz clic en **CREATE** +- Autentica la CLI de `gcloud` con la cuenta de Google que utilizaste para GCP -![](images/gcp_create_key.png) + + ```bash + gcloud auth login + ``` + -El navegador acaba de guardar la 🔑 del archivo json de la cuenta de servicio en tu carpeta de descargas (el nombre se le asigna según el nombre de la cuenta de servicio. Es algo como `le-wagon-data-123456789abc.json`) +- Inicia sesión en tu cuenta de Google en la nueva pestaña que se abrió en tu navegador web +- Muestra tu cuenta activa y comprueba que aparece la dirección de correo electrónico que utilizaste para GCP -- Guarda el archivo json de la cuenta de servicio en un lugar que recuerdes. Por ejemplo: + ```bash + gcloud auth list + ``` -``` bash -/Users/MACOS_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` +- Establece tu proyecto actual (reemplaza `PROJECT_ID` por el `ID` de tu proyecto, por ejemplo, `wagon-bootcamp-123456`) -- Guarda la **ruta absoluta** al archivo `JSON` como una variable de entorno: + ```bash + gcloud config set project PROJECT_ID + ``` -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Nota:** cada vez que ejecutes este comando, agregará esta línea a tu archivo zshrc sin importar si la línea ya existe en el archivo. Si cometiste un error y necesitas arreglarlo, es preferible que abras el archivo y edites la línea! +- Muestra tu cuenta activa y tu proyecto actual, y comprueba que aparece tu proyecto -Puedes hacerlo ejecutando + ```bash + gcloud config list + ``` -```bash -code ~/.zshrc -``` +- Ahora vamos a configurar las credenciales predeterminadas de la aplicación para que tu código Python pueda acceder a GCP: -en la Terminal! 😄 + ```bash + gcloud auth application-default login + ``` + Esto abrirá una ventana del navegador. Inicia sesión con la misma cuenta de Google que utilizaste para crear tu proyecto de GCP. Tus credenciales se guardarán automáticamente. +- Verifiquemos que tus credenciales predeterminadas de la aplicación funcionan: -
- ℹ️ ¿Cómo encontrar la ruta absoluta de un archivo? - Puedes arrastrar el archivo a tu terminal. -
+ ```bash + gcloud auth application-default print-access-token + ``` -**Reinicia** tu terminal y ejecuta lo siguiente: + Deberías ver una cadena de token larga. Si aparece un error, vuelve a ejecutar `gcloud auth application-default login`. -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` +
+ Solución de problemas -Deberías obtener la siguiente información: + - `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.` + - Asegúrate de que la facturación esté habilitada para tu proyecto de Google Cloud Platform [https://cloud.google.com/billing/docs/how-to/modify-project](https://cloud.google.com/billing/docs/how-to/modify-project) +
-```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -Ahora verifica si la ruta al archivo json de tu cuenta de servicio es el correcto: - -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` - -👉 Este comando debería mostrar el contenido del archivo json de tu cuenta de servicio. Si no es el caso, pídele ayuda a un TA 🙏 - -Tu código y utilidades ahora pueden acceder a los recursos de tu cuenta GCP. - -Continuemos con los últimos pasos de la configuración... - -- Lista las cuentas de servicio asociadas a tu cuenta activa y a tu proyecto actual -```bash -gcloud iam service-accounts list -``` -- Recupera el email de la cuenta de servicio e. g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- Lista los roles de la cuenta de servicio desde la cli (reemplaza el PROJECT_ID y el SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- Ahora deberías ver que tu cuenta de servicio tiene el rol de `roles/owner` - -
- Resolución de problemas - -- `AccessDeniedException: 403 The project to be billed is associated with an absent billing account.`. Esto significa que el proyecto a facturar está asociado a una cuenta de facturación que no está habilitada - - Asegúrate de habilitar la facturación para tu proyecto https://cloud.google.com/billing/docs/how-to/modify-project -
+🏁 ¡Has terminado la configuración de GCP! -🏁 Listo. ¡Has terminado la configuración de GCP! - ## Kitt +## Kitt Deberías haber recibido un correo electrónico de Le Wagon invitándote a registrarte en [Kitt](https://kitt.lewagon.com) (nuestra plataforma de aprendizaje). diff --git a/macOS.md b/macOS.md index fe7cc9f3..098652a8 100644 --- a/macOS.md +++ b/macOS.md @@ -1,9 +1,11 @@ # Setup instructions -You will find below the instructions to set up you computer for [Le Wagon Data Science course](https://www.lewagon.com/data-science-course/full-time) +Below are the instructions for setting up your computer for the [Le Wagon Data Science & AI bootcamp](https://www.lewagon.com/data-science-course). -Please **read them carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand: +Please **read them carefully and execute all commands in the following order**. + +This setup is not an exercise; its sole purpose is to prepare your machine in a standardised way. Do not experiment or ask an LLM for help. If you get stuck, simply ask a teacher for help :raising_hand: Let's start :rocket: @@ -19,40 +21,16 @@ 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. - -Open a new terminal window from Applications > Utilities or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014): +## Check your processor -![Open Terminal on macOS](images/macos_open_terminal.png) - -Copy-paste the following command in the terminal and hit `Enter` to execute. - -``` bash -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)" -``` - -☝️ The result of the command should indicate whether your computer uses Apple Silicon. - -If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it. - -
- 👉  Setup for Apple Silicon 👈 +In line with our laptop requirements, this setup only supports Apple silicon architectures. **The setup does not work on Macs with Intel processors.** -You want to make sure that you are **not using** Rosetta, which is a way to use your Terminal as if you had an Intel computer. +If you purchased your Mac after late 2020, it likely features an Apple silicon chip. -Open the Finder app (or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014)). +To verify your processor, click the Apple icon in the top-left corner of your screen and select *"About This Mac"*. Check the *"Chip"* (or *"Processor"*) field: -Go to Applications > Utilities. - -Locate the Terminal app (select it). - -Press `Cmd` + `I` on the Terminal app, then verify that the box "Open using Rosetta" is **unchecked**. -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 +- ✔️ If it lists *"Apple"*, your machine is compatible. +- ❌ If it says *"Intel"*, your Mac is not supported. You cannot continue the setup, contact the teaching crew. ## A note about quitting apps on a Mac @@ -65,7 +43,11 @@ During this setup you will be asked to **quit and re-open** applications multipl ## Command Line Tools -Open a new terminal, copy-paste the following command and hit `Enter`: +Open a new terminal window from Launchpad > Other, or from Finder > Applications > Utilities, or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014): + +![Open Terminal on macOS](https://github.com/lewagon/setup/blob/master/images/macos_open_terminal.png) + +Copy-paste the following command and hit `Enter`: ```bash xcode-select --install @@ -96,73 +78,45 @@ Once this is done, you can try to install again. ## Homebrew -### 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. -To do so, open your Terminal and run: + +[Homebrew](http://brew.sh/) is a package manager: it's a software used to install other software from the command line. Let's install it! + +Open a terminal and run: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` This will ask for your confirmation (hit `Enter`) and your **macOS user account password** (the one you use to [log in](https://support.apple.com/en-gb/HT202860) when you reboot your Macbook). -:warning: When typing a password in the Terminal, you will **not** get a visual feedback (something like `*****`), this is **normal**!! Type the password and confirm by typing `Enter`. - -
- 🛠 If you get a Error: Not a valid ref: refs/remotes/origin/master error - -The full error would be: - -``` bash -Error: Not a valid ref: refs/remotes/origin/master : -fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree. -``` - -Run the following commands to solve it: - -``` bash -rm -fr $(brew --repo homebrew/core) # because you can't `brew untap homebrew/core` -brew tap homebrew/core -``` - -
+: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`. If you already have Homebrew, it will tell you so, that's fine, go on. -### 2. Make sure you are on the latest version: +Once Homebrew has finished installing, run these two commands to add it to your `PATH`: ```bash -brew update +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$(/opt/homebrew/bin/brew shellenv)" ``` -
- 🛠 If you get a /usr/local must be writable error - -Just run this: +Make sure you're on the latest version: -``` bash -sudo chown -R $USER:admin /usr/local +```bash brew update ``` -
- -### 3. Then install some useful software: - -Proceed running the following in the terminal (you can copy / paste all the lines at once). +Then install some useful software (you can copy / paste all the lines at once): ```bash -brew upgrade git || brew install git -brew upgrade gh || brew install gh -brew upgrade wget || brew install wget -brew upgrade imagemagick || brew install imagemagick -brew upgrade jq || brew install jq -brew upgrade openssl || brew install openssl -brew upgrade tree || brew install tree -brew upgrade ncdu || brew install ncdu -brew upgrade xz || brew install xz -brew upgrade readline || brew install readline +brew upgrade git || brew install -y git +brew upgrade gh || brew install -y gh +brew upgrade wget || brew install -y wget +brew upgrade imagemagick || brew install -y imagemagick +brew upgrade jq || brew install -y jq +brew upgrade openssl || brew install -y openssl +brew upgrade tree || brew install -y tree +brew upgrade direnv || brew install -y direnv ``` @@ -227,7 +181,7 @@ For the start of the bootcamp, we’ll disable these features. At the right poin In **VS Code**: -1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS). +1. Let's open the VS Code "Command **P**alette": type `Cmd-Shift-P`. 1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it. ![The Command Palette at the top of the screen](https://github.com/lewagon/setup/blob/master/images/vscode_find_aifeatures.png) 1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option. @@ -257,18 +211,6 @@ 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). @@ -325,179 +267,144 @@ gh auth status ## 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. +Let's enhance the experience of your machine by installing Le Wagon's pre-configured [dotfiles 🔗](https://github.com/lewagon/dotfiles). These are configuration files for your terminal, zsh, git, and VS Code. -### Check your GitHub CLI configuration -First, let's do a quick check. Open your terminal and run the following command: +### Get your GitHub username + +Run the following command: ```bash export GITHUB_USERNAME=`gh api user | jq -r '.login'` echo $GITHUB_USERNAME ``` -You should see your GitHub username printed. If it's not the case, **stop here** and ask for help. -There seems to be a problem with the previous step (`gh auth`). +✔️ You should see your Github username printed. -### Fork and/or clone dotfiles +❌ If not, stop here and ask for help. There may be a problem with the previous step (`gh auth`). -There are three options, choose **one**: +### Forking the dotfiles -
- - I did not attend the Web Dev or Data Science & AI bootcamp at Le Wagon - - - As your configuration is personal, you need your own repository storing it, so you'll need to fork it to your GitHub account. - -Forking means that it will create a new repo in your GitHub account, identical to the original one. You'll have a new repository on your GitHub account, `your_github_username/dotfiles`. We need to fork because each of you will need to put specific information (e.g. your name) in those -files. - -Lets' run this command to fork the repo, and clone it on your laptop: - -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo fork lewagon/dotfiles --clone -``` - -
+To customise this configuration for yourself, you'll need to **fork** the repository to your own Github account. +**Forking** creates a copy of the repository under your account (`your_github_username/dotfiles`), which you can then modify with your personal information, such as your name.
- - I already attended a Le Wagon coding bootcamp (Web Development or Data Science & AI) but I have a new laptop - +If you already did another Le Wagon bootcamp (Web Development, AI Software Development, Data Analytics, Data Science & AI, open a ticket with a TA and open this for instructions ❗ + -This means that you already forked the GitHub repo `lewagon/dotfiles`, but at that time the configuration was maybe not ready for the current Data Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** +You may have an older version of the Le Wagon dotfiles. They could be incompatible with the current setup. -First, clone your fork on this machine: -```bash -mkdir -p ~/code/$GITHUB_USERNAME && cd $_ -gh repo clone $GITHUB_USERNAME/dotfiles -``` - - -Open your terminal and go to your `dotfiles` project: +**Together with a TA**, do one of the following: -```bash -cd ~/code/$GITHUB_USERNAME/dotfiles -``` +
+I'm using the same machine (or a new machine which already has the dotfiles). -Time to merge the changes from `lewagon/dotfiles` into yours: -1. Commit your current version of your dotfiles: +1. Move into your existing dotfiles folder: ```bash - git add . - git status # Check what will be committed - git commit -m "Version prior to new setup" + cd ~/code/$GITHUB_USERNAME/dotfiles ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` - -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Check the diff against the current version of Le Wagon's dotfiles: + ```bash + git diff upstream/master + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +If there is no meaningful difference other than your name and email setting, continue with the setup. -1. If nothing seems out of the ordinary, continue +
- Too many conflicts? - - - Let's just take over the current version from `lewagon/dotfiles`. - - First abort the merge: `git merge --abort`. +I'm using a new machine without the dotfiles. - Run `code .` +1. Browse to GitHub and find your `dotfiles` repository. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Check how many commits it's behind and ahead `lewagon/dotfiles:master`. You can see this just above the file list. - Still in VS Code, open the `zprofile` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Save to disk. +1. Click through to the behind and the ahead, and scroll down to see the diffs. - Back in the terminal, run a `git diff` and check if this didn't remove any personal configuration setting that you wanted to keep. +If there is no meaningful difference other than your name and email setting, continue with the setup.
-Time to commit your changes and push them. +
+The previous step revealed meaningful differences. -```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master -``` +If you are OK with losing your existing dotfiles (recommended): -
+Be aware that this will remove any personal changes you made to your shell configuration, like loading extra utilites, or changing the look and feel of your shell. If you're not aware of any changes you made yourself, this should be fine. +1. Delete your existing dotfiles repository on GitHub. +1. Delete the local repository: + ```bash + cd ~/code && rm -rf ~/code/$GITHUB_USERNAME/dotfiles + ``` +1. Continue with the setup.
- - I already did the setup of a Le Wagon coding bootcamp (WebDev or Data Science & AI) 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 Science & AI bootcamp. Let's update it. **Ask a TA to join you for the nex steps.** +If you do not want to lose your existing dotfiles, we recommend working with branches. Click to open. +On your **laptop**, or wherever you have a **local** copy of **your existing version of dotfiles**. -Open your terminal and go to your `dotfiles` project: - -```bash -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 - git commit -m "Version prior to new setup" - ``` -1. Let's bring in the changes from upstream: `git merge upstream/master` + ```bash + git add . + git status # Check what will be committed + git commit -m "Version prior to new setup" + ``` -1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. +1. Create a branch of your current dotfiles setup, and push to GitHub: + + ```bash + git checkout -b old-setup + git push origin old-setup + ``` -1. Do a `git diff HEAD~1 HEAD` to check what changed. +1. Go back to `master`: `git checkout master`. -1. If nothing seems out of the ordinary, continue +1. On local `master`, `git pull upstream master`. -
- Too many conflicts? - +1. Check that you're not in `MERGING` state. If you are, resolve any conflicts. + + It is important that you accept incoming changes to the `.zshrc`, `.zprofile`, and `settings.json` files. Especially anything related to `pyenv` and to Python environments. - Let's just take over the current version from `lewagon/dotfiles`. + If there are too many conficts, use your code editor to replace the contents of the conflicting files with the ones from [the Le Wagon dotfiles](https://www.github.com/lewagon/dotfiles). - First abort the merge: `git merge --abort`. + Commit your conflict resolution: `git commit --no-edit` - Run `code .` +1. Push your changes to GitHub: `git push origin master`. - In VS Code, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. +1. Continue with the setup. - Still in VS Code, 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. +
-Time to commit your changes and push them. +
+ +Time to fork the repo and clone it on your computer: ```bash -git add . -git commit -m "Update for Data Science bootcamp" -git push origin master +mkdir -p ~/code/$GITHUB_USERNAME && cd $_ +gh repo fork lewagon/dotfiles --clone ``` -
- +If you're asked _"Are you sure you want to continue connecting (yes/no/[fingerprint])?"_, type `yes` followed by `Enter`. -### Run the dotfiles installer +### Installing the dotfiles -It's time to run the `dotfiles` installer: +Run the `dotfiles` installer with: ```bash cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh ``` -Check the emails registered with your GitHub Account. You'll need to pick one at the next step: +Check the emails registered with your GitHub Account. You'll need to pick one in the next step: ```bash gh api user/emails | jq -r '.[].email' @@ -510,237 +417,113 @@ cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh ``` :point_up: This will **prompt** you for your name (`FirstName LastName`) and your email. -:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. - -Please now **quit** all your opened terminal windows. - - -## Installing Python (with [`pyenv`](https://github.com/pyenv/pyenv)) -### Uninstall `conda` +:warning: You **need** to put one of the emails listed above from the previous `gh api ...` command. If you don't do that, Kitt will not be able to track your progress. -As we are using `pyenv` to install and manage our Python version, we need to uninstall [`conda`](https://docs.conda.io/projects/conda/en/latest/), another package manager you may have on your machine if you previously installed [Anaconda](https://www.anaconda.com/). Thus, we are preventing any possible Python version issue later. +💡 Select the `...@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to. -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 pre-requisites** section. - - -
- conda uninstall instructions +## direnv -- Install the Anaconda-Clean package from your terminal and run the cleaning -```bash -conda install anaconda-clean -anaconda-clean --yes -``` -- Remove every Anaconda directories -```bash -rm -rf ~/anaconda2 -rm -rf ~/anaconda3 -rm -rf ~/.anaconda_backup +[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. -rm -rf ~/opt +``` bash +brew install -y direnv +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -- 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` - - Remove the code lines starting from `>>> conda initialize >>>` to `<<< conda initialize <<<` -
-### Install pre-requisites +## Install Python and dependencies -Before installing Python, please check your `xz` version with: +Your operating system - macOS, or Ubuntu (native, or inside WSL) - comes with a "system Python". That's a Python version your system depends on. We don't mess around with that one. We're going to do a professional setup of Python where you don't mess up your "system Python" and where you'll be able to switch which version you want to use for each project you work on. -```bash -brew info xz -``` +To manage different Python versions and virtual environments (you'll discover what that means during the setup lecture), we will use the state-of-the-art [`uv` created by Astral](https://docs.astral.sh/uv/). -It should be more than `5.2.0`, **if not** you should run: -```bash -sudo rm -rf /usr/local/opt/xz -brew upgrade -brew install xz -``` +### Install `uv` -Then run: +First, we'll install `uv`: ```bash -brew install readline +curl -LsSf https://astral.sh/uv/install.sh | sh ``` -### Install `pyenv` - -macOS 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 Science 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. - -First let's install `pyenv` with the following Terminal command: +Next, restart your shell by running this: ```bash -brew install pyenv exec zsh ``` -### Install Python +### Create a virtual environment -Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: +Next, we'll create a virtual environment (an isolated environment with Python and the dependencies for the bootcamp): ```bash -pyenv install 3.12.9 -``` - -This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! - -
- 🛠 Troubleshooting `pyenv` not found - -If you encounter an error `Command 'pyenv' not found`: execute the following line: - -```bash -source ~/.zprofile -``` - -Then try to install Python again: - -```bash -pyenv install 3.12.9 -``` - -If `pyenv` is still not found, contact a teacher. - -
- - -
- 🛠 Troubleshooting `zlib` - -If you encounter an error installing Python with `pyenv` about `zlib`: - -```txt -zipimport.ZipImportError: can't decompress data; zlib not available +uv venv ~/.lewagon/venvs/lewagon --python 3.12.9 ``` -Install `zlib` with: +Now that we created this new virtual environment, let's restart our shell to pick it up (this works thanks to the `lewagon/dotfiles` we installed before): ```bash -brew install zlib -export LDFLAGS="-L/usr/local/opt/zlib/lib" -export CPPFLAGS="-I/usr/local/opt/zlib/include" +exec zsh ``` -Then try to install Python again: +Let's check that everything went right. Run this: ```bash -pyenv install 3.12.9 +which python3 ``` -It could raise another error about `bzip2`, you can ignore it and continue to the next step. +It should return this: -
-
-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 3.12.9 -exec zsh +``` bash +/Users/your-username/.lewagon/venvs/lewagon/bin/python3 ``` -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). -### Setup a virtualenv +If it doesn't, check with a TA! Do not continue with the next step before you solved this! -First let's install this plugin: -```bash -git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv -exec zsh -``` +### Install dependencies -Let's create the virtual environment we are going to use during the whole bootcamp: +Python is great for data, because the community has developed an enormous amount of packages we can re-use. -```bash -pyenv virtualenv 3.12.9 lewagon -``` +Let's install the most common ones: -Let's now set the virtual environment with: -```bash -pyenv global lewagon +``` bash +uv pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_silicon.txt ``` -Great! Anytime we'll install Python package, we'll do it in that environment. -### Python packages +## Jupyter Notebook tweaking -Now that we have a pristine `lewagon` virtual environment, it's time to install some packages in it. +Depending on your system, we need to make some small changes to your Jupyter configuration. -First, let's upgrade `pip`, the tool to install Python Packages from [pypi.org](https://pypi.org). In the latest terminal where the virtualenv `lewagon` is activated, run: +Run this: ```bash -pip install --upgrade pip +bash -c "$(curl -s https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/checks/setup_jupyter.sh)" ``` -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. -
- 👉  Setup for Apple Silicon 👈 +If you are curious about what happens here, click here. -``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_silicon.txt -``` -
+This script adds a configuration to improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. -If your computer uses **Apple Intel**, expand the paragraph below and go through it. Otherwise ignore it. +If you're using Windows WSL, it also fixes some other problems. -
- 👉  Setup for Apple Intel 👈 -``` bash -pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.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. - -Run the following lines to create a `custom.css` stylesheet in your Jupyter config directory: - -```bash -LOCATION=$(jupyter --config-dir)/custom -SOURCE=https://raw.githubusercontent.com/lewagon/data-setup/refs/heads/master/specs/jupyter/custom.css -mkdir -p $LOCATION -curl $SOURCE > $LOCATION/custom.css -``` - - ## Python setup check -### Python and packages check +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -748,42 +531,17 @@ Let's reset your terminal: 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 -``` - -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)" -``` - -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)" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -801,8 +559,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -814,21 +570,25 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` 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. +In another cell, run: +```python +import pandas as pd +pd.__version__ +``` +This might take a few minutes to run. It should output a version number, `2.2.3`. If not, check with a TA. -## DBeaver +You can close your web browser then terminate the jupyter server with `CTRL` + `C`. -Download and install [DBeaver](https://dbeaver.io/), a free and open source powerful tool to connect to any database, explore the schema and even **run SQL queries**. +Here you have it! A complete python virtual env with all the third-party packages you'll need for the whole bootcamp. ## Docker 🐋 @@ -856,66 +616,43 @@ You should get: ![](images/docker_info.png) +## Google Cloud Platform setup -## `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: - -```bash -brew install --cask google-cloud-sdk -``` - -Then you can: - -```bash -$(brew --prefix)/share/google-cloud-sdk/install.sh -``` - -
- Getting a no such file or directory error? - - - Try this: - -```bash -$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/install.sh -``` - -If that doesn't work, contact a TA. - -
- +[Google Cloud](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. -## Google Cloud Platform setup +🚨 If you are a student of the **Part-Time Bootcamp or the Flex bootcamp**, SKIP THIS SECTION FOR NOW! **Google Cloud** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your Google Cloud account too soon 🙅‍♂️ -[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. -🚨 If you are a student of the **Part-Time Bootcamp**, SKIP THIS SECTION FOR NOW! **GCP** offers $300 worth of free credits for a duration of 3 months. You do not want to activate your GCP account too soon 🙅‍♂️ ### Project setup - Go to [Google Cloud](https://console.cloud.google.com/) and create an account if you do not already have one - In the Cloud Console, on the project list, select or create a Cloud project +⚠️ **Important:** When creating a new project, you will see an **Organization** field. Leave this set to **"No organization"**. Do not select or create an organization. Choosing an organization applies restrictions that can prevent you from using Google Cloud services during the bootcamp. + ![](images/gcp-create-project.png) - Give it a name such as `Wagon Bootcamp` for example -- ❗ Check that the field _Location_ is set to _No organization_ ❗ - Notice the `ID` automatically created for the project, e.g. `wagon-bootcamp-123456` ![](images/gcp_project.png) +ℹ️ Note the **Project ID** (e.g. `wagon-bootcamp-123456`) this is **not** the same as the project name you chose (e.g. `Wagon Bootcamp`). You will need the ID later when running terminal commands, but don't worry, you can always find it in Google Cloud. + ### Account language -In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: +In order to facilitate the following of the instructions during the bootcamp, open your Google Cloud 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** @@ -923,7 +660,9 @@ Then switch the language to english: ### Billing account -You will now link your account to your credit card. This step is required or you will not be able to use the services provided by GCP. Do not worry, you will be able to consume most GCP services through free credits throughout the bootcamp. +You will now link your account to your credit card. This step is required or you will not be able to use the services provided by Google Cloud. Do not worry, you will be able to consume most Google Cloud services through free credits throughout the bootcamp. + +⚠️ In some cases, Google may charge your card (around €10) to verify that it is valid. This will unfortunately not be refunded once you are approved, but will be added as credit in Google Cloud that you can use once your free credits have been used or expired. ![](images/gcp-billing.png) @@ -931,18 +670,18 @@ You will now link your account to your credit card. This step is required or you - Click on **MANAGE BILLING ACCOUNTS** - Click on **ADD BILLING ACCOUNT** - Give a name to your billing account, e.g. `My Billing Account` -- Click on "I have read..." and agree the to the terms of service +- Click on "I have read..." and agree to the terms of service - Click on **CONTINUE** - Select your account type: `Individual` - Fill your name and address -You should see that you have a free credit of "$300 credits over the next 90days". +You should see that you have a free credit of "$300 credits over the next 90 days". - Click on card details - Enter your credit card info - Click on **START MY FREE TRIAL** -Once this is done, verify that your billing account is linked to your GCP project. +Once this is done, verify that your billing account is linked to your Google Cloud project. - Select your project - Go to **Billing** @@ -952,14 +691,13 @@ 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. @@ -976,26 +714,26 @@ Download the Revolut app, or go to [revolut](https://www.revolut.com/a-radically Once this is done, select the standard (free) plan. No need to add the card to Apple pay, or ask for a the delivery of a physical card, or add money securely. -You now have a virtual card which we will use for the GCP setup. +You now have a virtual card which we will use for the Google Cloud setup. + +In the main view of the Revolut app -In the main view of the Revolut the app - Click on Ready to use - Click on the card - Click on Show card details -- Note down the references of the virtual credit card and use them in order to proceed with the GCP setup +- Note down the references of the virtual credit card and use them in order to proceed with the Google Cloud setup
👉 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 - You will be asked to send a picture of your credit card (only the last 4 digits, no other info) - In case you used **Revolut**, you can send a screenshot of your virtual credit card (do not forget to remove the validity date from the screenshot) -- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup GCP for the bootcamp using a virtual credit card +- Explain that you are attending the Le Wagon bootcamp, do not own a credit card, and have just created a Revolut account in order to setup Google Cloud for the bootcamp using a virtual credit card You may receive a validation or requests for more information within 30 minutes. @@ -1003,7 +741,7 @@ Once the verification goes through, you should receive an email stating that "Yo
-### Enabling GCP services +### Enabling Google Cloud services - Make sure that billing is enabled for your Google Cloud project @@ -1011,187 +749,99 @@ Once the verification goes through, you should receive an email stating that "Yo - [Enable the BigQuery and Compute Engine APIs](https://console.cloud.google.com/flows/enableapi?apiid=bigquery,compute) (This step may take a few minutes) -### Configure Cloud sdk +That's it for the browser setup! Terminal setup comes later in this guide. -- Authenticate the `gcloud` CLI with the google account you used for GCP -```bash -gcloud auth login -``` +## Google Cloud CLI +### Install `gcloud` + +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: -- 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 -```bash -gcloud auth list -``` -- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) ```bash -gcloud config set project PROJECT_ID +brew install -y --cask google-cloud-sdk ``` -- List your active account and current project and check your project is present + +Then you can: + ```bash -gcloud config list +$(brew --prefix)/share/google-cloud-sdk/install.sh ``` -### Create a service account key 🔑 - -Now that you have created a `GCP account` and a `project` (identified by its `PROJECT_ID`), we are going to configure the actions (API calls) that you want to allow your code to perform. +When asked if you want to make updates, choose `y`. When asked for the path to an rc file, hit `Enter` to accept the default `.zshrc`.
- 🤔 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 resources 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. - - 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. + Getting a no such file or directory error? + - 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. + Try this: - In the same way that there may be several projects associated with a GCP account, a project may be composed of several services (any bundle of code, whatever its form factor, that requires the usage of GCP API calls in order to fulfill its purpose). +```bash +$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/install.sh +``` - GCP requires that the services of the projects using API calls are registered on the platform and their credentials configured through the access granted to a `service account`. +If that doesn't work, contact a TA. - For the moment we will only need to use a single service and will create the corresponding `service account`.
-Since the [service account](https://cloud.google.com/iam/docs/service-accounts) is what identifies your application (and therefore your GCP billing account and ultimately your credit card), you are going to want to be cautious with the next steps. - -⚠️ **Do not share you service account json file 🔑** ⚠️ Do not store it on your desktop, do not store it in your git codebase (even if your git repository is private), do not let it by the coffee machine, do not send it as a tweet. - -#### Go to the Service Accounts page - -Navigate to the GCP service accounts page at [this link](https://console.cloud.google.com/apis/credentials/serviceaccountkey). - -- Select your project in the list of recent projects if asked to. -- If not asked, make sure the right project is selected in the Project selecter list at the top of the page. - -An alternate way to navigate to the Service Accounts page is from the following: - -01 Go to Service Accounts - -#### Create a service account - -- Click on **CREATE SERVICE ACCOUNT**. - - 02 Create Service Account - -- Give your service account a name, an id and a description, and click on **CREATE AND CONTINUE**. - - 03 Name the service account - -- Click on **Select a role** and choose `Basic` then **`Owner`**, which gives the service account full access to all resources of your GCP project. - - 04 Add BigQuery Job User - -- Click on the blue **DONE** button at the bottom of this window. We don't need to worry about the section *Grant your users access to this service account*. - - 04 Done - - -#### Create a json key 🔑 for this service account - -- On the service accounts page, click on the email address of the newly created service account. - 05 Select the service account +### Configure the Google Cloud CLI -- Click on the **KEYS** tab at the top of the page. - - 06 Go to Keys - - -- Click on **ADD KEY** then **Create new key**. - - 07 Add Key - - -- Select **JSON** and click on **CREATE**. - - 08 Choose JSON and Create - -- 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 -/Users/MACOS_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` - -- Store the **absolute path** to the `JSON` file as an environment variable: - -``` bash -echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc -``` -**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line! - -You can do so by running - -```bash -code ~/.zshrc -``` +- Authenticate the `gcloud` CLI with the google account you used for GCP -in the Terminal! 😄 + ```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 -
- ℹ️ How to find the absolute path of a file? - You can drag and drop the file in your terminal. -
+ ```bash + gcloud auth list + ``` -**Restart** your terminal and run: +- Set your current project (replace `PROJECT_ID` with the `ID` of your project, e.g. `wagon-bootcamp-123456`) -``` bash -echo $GOOGLE_APPLICATION_CREDENTIALS -``` + ```bash + gcloud config set project PROJECT_ID + ``` -The ouptut should be the following: +- List your active account and current project and check your project is present -```bash -/some/absolute/path/to/your/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json -``` + ```bash + gcloud config list + ``` -Now let's verify that the path to your service account json file is correct: +- Now let's set up Application Default Credentials so your Python code can access GCP: -``` bash -cat $(echo $GOOGLE_APPLICATION_CREDENTIALS) -``` + ```bash + gcloud auth application-default login + ``` -👉 This command should display the content of your service account json file. If it does not, ask for a TA 🙏 + This will open a browser window. Log in with the same Google account you used to create your GCP project. Your credentials will be saved automatically. -Your code and utilities are now able to access the resources of your GCP account. +- Let's verify your Application Default Credentials are working: -Let's proceed with the final steps of configuration... + ```bash + gcloud auth application-default print-access-token + ``` -- List the service accounts associated to your active account and current project -```bash -gcloud iam service-accounts list -``` -- Retrieve the service account email address, e.g. `SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com` -- List the roles of the service account from the cli (replace PROJECT_ID and SERVICE_ACCOUNT_EMAIL) -```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" -``` -- You should see that your service account has a role of `roles/owner` + You should see a long token string. If you see an error, run `gcloud auth application-default login` again. -
- Troubleshooting +
+ 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 -
+ - `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](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). diff --git a/macOS_keep_current.es.md b/macOS_keep_current.es.md index 973ee8d9..7d74e7e3 100644 --- a/macOS_keep_current.es.md +++ b/macOS_keep_current.es.md @@ -304,18 +304,6 @@ Verifica tu versión de Python con los siguientes comandos: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh)" 3.12.9 ``` -Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: -```bash -zsh -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh)" -``` - -Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: -```bash -python -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py)" -``` - -### Chequeo de Jupyter - Ahora verifica que puedas iniciar un servidor de notebook en tu máquina: ```bash @@ -341,6 +329,15 @@ import sys; sys.version Debería mostrar `3.12.9` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. +En otra celda, ejecuta: + +```python +import pandas as pd +pd.__version___ +``` + +Esto podría tomar algunos minutos en ejecutarse. Debería mostrar un número de versión, `2.2.3`. Si no es así, consulta con un TA. + Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. ¡Listo! Ya tienes un virtual env de python completo con todos los paquetes tercerizados que necesitarás en el bootcamp. diff --git a/macOS_keep_current.md b/macOS_keep_current.md index 9890f7e0..f2efdbdb 100644 --- a/macOS_keep_current.md +++ b/macOS_keep_current.md @@ -291,7 +291,7 @@ Stop the Docker app ## Python setup check -### Python and packages check +Let's run some checks. If any of the following steps fail, ask a TA for help. Let's reset your terminal: @@ -299,42 +299,17 @@ Let's reset your terminal: 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 -``` - -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)" -``` - -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)" -``` - -### Jupyter check - Make sure you can run Jupyter: ```bash jupyter notebook ``` -Let's open the jupyter app: - -
- - Regular setup - - Your web browser should open on a `jupyter` window. -
- +Your web browser should open on a `jupyter` window.
- Virtual machine setup + Note if you're running the setup on a virtual machine VSCode detects that a jupyter notebook started in your virtual machine and creates a port forward in order to allow you to open the application in your browser. @@ -352,8 +327,6 @@ Let's open the jupyter app:
-You now have access to the `jupyter` window: - ![jupyter.png](images/jupyter.png) Click on `New` and in the dropdown menu select `Python 3 (ipykernel)`: @@ -365,12 +338,22 @@ A tab should open on a new notebook: ![jupyter_notebook.png](images/jupyter_notebook.png) Make sure that you are running the correct python version in the notebook. Open a cell and run: + ``` python import sys; sys.version ``` It should output `3.12.9` followed by some more details. If not, check with a TA. +In another cell, run: + +```python +import pandas as pd +pd.__version__ +``` + +This might take a few minutes to run. It should output a version number, `2.2.3`. 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.