diff --git a/LINUX.md b/LINUX.md index 3e4257e..5437326 100644 --- a/LINUX.md +++ b/LINUX.md @@ -19,6 +19,140 @@ 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. +## 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 + +âš ī¸ **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 GCP 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 GCP. + +### Account language + +In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) + +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. + +âš ī¸ 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 GCP 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 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: + +```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 GCP 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 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) + +That's it for the browser setup! Terminal setup comes later in this guide. + + ## Visual Studio Code ### Installation @@ -745,131 +879,6 @@ Here you have it! A complete python virtual env with all the third-party package - Install Insomnia -## Google Cloud Platform setup - -[GCP](https://cloud.google.com/) is a cloud solution that you are going to use in order to deploy your Machine Learning-based products to production. - -🚨 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 -- 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](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: - -```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 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 - Authenticate the `gcloud` CLI with the google account you used for GCP @@ -899,152 +908,23 @@ gcloud config set project PROJECT_ID 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 -``` - -- 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! 😄 - - - -
- â„šī¸ 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: +Now let's set up Application Default Credentials so your Python code can access GCP: ```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) +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 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) +Let's verify your Application Default Credentials are working: ```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" +gcloud auth application-default print-access-token ``` -- 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 diff --git a/WINDOWS.md b/WINDOWS.md index fcf4292..d67270f 100644 --- a/WINDOWS.md +++ b/WINDOWS.md @@ -19,6 +19,140 @@ 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. +## 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 + +âš ī¸ **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 GCP 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 GCP. + +### Account language + +In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) + +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. + +âš ī¸ 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 GCP 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 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: + +```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 GCP 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 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) + +That's it for the browser setup! Terminal setup comes later in this guide. + + ## Windows version Before we start, we need to check that the version of Windows installed on your computer is compatible with this setup instructions. @@ -1288,131 +1422,6 @@ Some Python packages require a compiler to function properly. Let's install one: [For x64 systems](https://aka.ms/vs/16/release/vc_redist.x64.exe) -## Google Cloud Platform setup - -[GCP](https://cloud.google.com/) is a cloud solution that you are going to use in order to deploy your Machine Learning-based products to production. - -🚨 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 -- 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](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: - -```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 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 - Authenticate the `gcloud` CLI with the google account you used for GCP @@ -1442,210 +1451,23 @@ gcloud config set project PROJECT_ID 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: - -```bash -\\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! 😄 - - - -
- â„šī¸ 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: +Now let's set up Application Default Credentials so your Python code can access GCP: ```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) +gcloud auth application-default login --no-launch-browser ``` -👉 This command should display the content of your service account json file. If it does not, ask for a TA 🙏 +Copy the URL shown in the terminal, open it in your Windows browser, and log in with the same Google account you used to create your GCP project. Once you approve access, copy the verification code from the browser and paste it back into the terminal. Your credentials will be saved automatically. -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) +Let's verify your Application Default Credentials are working: ```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" +gcloud auth application-default print-access-token ``` -- 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 diff --git a/_partials/gcp_account_setup.md b/_partials/gcp_account_setup.md new file mode 100644 index 0000000..6b3a870 --- /dev/null +++ b/_partials/gcp_account_setup.md @@ -0,0 +1,132 @@ +## 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 + +âš ī¸ **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 GCP 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 GCP. + +### Account language + +In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) + +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. + +âš ī¸ 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 GCP 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 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: + +```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 GCP 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 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) + +That's it for the browser setup! Terminal setup comes later in this guide. diff --git a/_partials/gcp_setup.md b/_partials/gcp_setup.md index 2591573..0e31d89 100644 --- a/_partials/gcp_setup.md +++ b/_partials/gcp_setup.md @@ -1,128 +1,3 @@ -## 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 -- 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](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: - -```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 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 - Authenticate the `gcloud` CLI with the google account you used for GCP @@ -159,78 +34,3 @@ gcloud config set project PROJECT_ID ```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`). diff --git a/_partials/gcp_setup_end.md b/_partials/gcp_setup_end.md index 1bbcf28..edc5cc7 100644 --- a/_partials/gcp_setup_end.md +++ b/_partials/gcp_setup_end.md @@ -1,50 +1,10 @@ - -
- â„šī¸ 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) +Let's verify your Application Default Credentials are working: ```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" +gcloud auth application-default print-access-token ``` -- 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 diff --git a/_partials/gcp_setup_linux.md b/_partials/gcp_setup_linux.md deleted file mode 100644 index e13f112..0000000 --- a/_partials/gcp_setup_linux.md +++ /dev/null @@ -1,21 +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 index 95a6c47..6cfb638 100644 --- a/_partials/gcp_setup_mid.md +++ b/_partials/gcp_setup_mid.md @@ -1,21 +1,7 @@ -- 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 +Now let's set up Application Default Credentials so your Python code can access GCP: ```bash -code ~/.zshrc +gcloud auth application-default login ``` -in the Terminal! 😄 +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. diff --git a/_partials/gcp_setup_wsl.md b/_partials/gcp_setup_wsl.md index 8fa4934..72ee484 100644 --- a/_partials/gcp_setup_wsl.md +++ b/_partials/gcp_setup_wsl.md @@ -1,79 +1,7 @@ -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: - -```bash -\\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 +Now let's set up Application Default Credentials so your Python code can access GCP: ```bash -code ~/.zshrc +gcloud auth application-default login --no-launch-browser ``` -in the Terminal! 😄 +Copy the URL shown in the terminal, open it in your Windows browser, and log in with the same Google account you used to create your GCP project. Once you approve access, copy the verification code from the browser and paste it back into the terminal. Your credentials will be saved automatically. diff --git a/builds/LINUX.yml b/builds/LINUX.yml index 06ef97c..2ffd079 100644 --- a/builds/LINUX.yml +++ b/builds/LINUX.yml @@ -4,6 +4,7 @@ locales: [en] partials: - intro - setup/github + - gcp_account_setup - setup/ubuntu_vscode - vscode_extensions - setup/cli_tools @@ -27,7 +28,7 @@ partials: - python_checkup - insomnia - gcp_setup - - gcp_setup_linux + - gcp_setup_mid - gcp_setup_end - kitt - setup/ubuntu_slack diff --git a/builds/WINDOWS.yml b/builds/WINDOWS.yml index a213bb4..9bac9c2 100644 --- a/builds/WINDOWS.yml +++ b/builds/WINDOWS.yml @@ -4,6 +4,7 @@ locales: [en] partials: - intro - setup/github + - gcp_account_setup - setup/windows_version - setup/windows_virtualization - setup/windows_wsl diff --git a/builds/macOS.yml b/builds/macOS.yml index 7b9c0a3..1fd3f05 100644 --- a/builds/macOS.yml +++ b/builds/macOS.yml @@ -4,6 +4,7 @@ locales: [en] partials: - intro - setup/github + - gcp_account_setup - osx_silicon - setup/macos_command_line_tools - homebrew diff --git a/macOS.md b/macOS.md index 5921be9..56680cd 100644 --- a/macOS.md +++ b/macOS.md @@ -19,6 +19,140 @@ 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. +## 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 + +âš ī¸ **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 GCP 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 GCP. + +### Account language + +In order to facilitate the following of the instructions during the bootcamp, open your GCP account preferences: + +[https://myaccount.google.com/language](https://myaccount.google.com/language) + +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. + +âš ī¸ 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 GCP 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 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: + +```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 GCP 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 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) + +That's it for the browser setup! Terminal setup comes later in this guide. + + ## 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. @@ -835,131 +969,6 @@ If that doesn't work, contact a TA.
-## 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 -- 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](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: - -```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 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 - Authenticate the `gcloud` CLI with the google account you used for GCP @@ -989,152 +998,23 @@ gcloud config set project PROJECT_ID 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 -/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! 😄 - - - -
- â„šī¸ 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: +Now let's set up Application Default Credentials so your Python code can access GCP: ```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) +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 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) +Let's verify your Application Default Credentials are working: ```bash -gcloud projects get-iam-policy PROJECT_ID \ ---flatten="bindings[].members" \ ---format='table(bindings.role)' \ ---filter="bindings.members:SERVICE_ACCOUNT_EMAIL" +gcloud auth application-default print-access-token ``` -- 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 diff --git a/student_faq.md b/student_faq.md new file mode 100644 index 0000000..9fce83f --- /dev/null +++ b/student_faq.md @@ -0,0 +1,155 @@ +# Setup Day — Student FAQ + +Something not working? Try the fix below. If you've tried it and restarted your computer and it still doesn't work, raise your hand. + +--- + +## macOS + +### "I see `brew: command not found`" (or `pyenv: command not found`, or `direnv: command not found`) + +If you have an M1 or M2 Mac (Apple Silicon), Homebrew installs to a different location that your terminal doesn't know about yet. + +Fix — run these two commands: + +```bash +echo 'eval "$(/opt/homebrew/bin/brew shellenv 2> /dev/null)"' >> ~/.zprofile +source ~/.zprofile && exec zsh +``` + +Then try the original command again. + +--- + +### "I see a permissions error about directories not being writable" + +```bash +sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions +``` + +Then restart your terminal and try again. + +--- + +### "pyenv install failed with BUILD FAILED" + +Your Xcode developer tools need reinstalling: + +```bash +sudo rm -rf /Library/Developer/CommandLineTools +xcode-select --install +``` + +Wait for the install to finish (it takes a few minutes), then retry the `pyenv install` command. + +--- + +## Windows / WSL + +### "WSL install gave me a 403 Forbidden error" + +Your WiFi network is blocking the Microsoft download. Try either: + +- Connect to a mobile hotspot and retry +- Run `wsl --install --online` instead +- Install Ubuntu from the Microsoft Store directly + +--- + +### "Ubuntu/WSL is frozen or very slow" + +Open **Command Prompt** (not Ubuntu) and run: + +``` +wsl --shutdown +``` + +Then close all Ubuntu windows and reopen them. This is the correct way to restart WSL. Restarting Windows also works but takes much longer. + +--- + +### "The `code` command doesn't work in Ubuntu" + +Restart your computer. This almost always fixes it. + +--- + +### "I forgot my Ubuntu password" + +Ask a teacher — they can reset it for you. + +--- + +### "My CMD commands don't work / I see access errors" + +Right-click on Command Prompt and choose **"Run as administrator"**. + +--- + +## GCP + +### "I accidentally created an Organization when making my GCP project" + +Create a new GCP project: + +1. Go to the [Cloud Console](https://console.cloud.google.com/) +2. Click the project dropdown at the top → **New Project** +3. Give it a name (e.g. `Wagon Bootcamp 2`) +4. **Leave the Organization field as "No organization"** +5. Click Create + +Then continue from the step where you set your project in the terminal: + +```bash +gcloud config set project YOUR_NEW_PROJECT_ID +``` + +--- + +### "My gcloud commands return a 403 error" + +Run the authentication command again: + +```bash +gcloud auth application-default login +``` + +Make sure you log in with the **same Google account** that owns your GCP project (your personal Gmail, not a work or school account). + +Also check your Project ID is set correctly: + +```bash +gcloud config list project +``` + +The Project ID looks like `wagon-bootcamp-123456` — it's different from the project name you chose. + +--- + +### "I don't know my Project ID" + +```bash +gcloud config list project +``` + +Or go to [console.cloud.google.com](https://console.cloud.google.com/) — the Project ID is shown below the project name in the dashboard (format: `your-project-name-123456`). + +--- + +## SSH + +### "I set a passphrase but now I've forgotten it" + +You'll need to delete your SSH key and create a new one without a passphrase. Ask a teacher for help — they'll walk you through the three commands needed. + +--- + +## General + +### "I don't know if a step worked" + +Run the command shown in the guide. If you see no error message (just a new prompt `$`), it worked. If you see a line starting with `error:` or `fatal:` or `zsh: command not found`, it didn't. + +### "When should I ask for help?" + +If you've tried the fix above, restarted your computer, and it still doesn't work — raise your hand. Don't spend more than 5 minutes on the same error.