Skip to content

Commit

Permalink
Merge pull request #189 from learntocloud/adding-cap1
Browse files Browse the repository at this point in the history
updates to cap1 and cap2
  • Loading branch information
madebygps committed Jan 22, 2024
2 parents aa9861d + 8821ccc commit d416320
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 80 deletions.
22 changes: 14 additions & 8 deletions docs/phase1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The cloud is a bunch of Linux Servers networked together. Learning the fundament
<!--truncate -->
<iframe width="100%" height="315" src="https://www.youtube.com/embed/mxVq2DlPDWw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

Along side learning to code (Bash is code), you'll need leverage [Git](https://git-scm.com/). It's the most popular version control tool and one of the DevOps practices. It is used to manage and share your code. GitHub is one of the most popular repository hosting service.

Take some time now to create a [GitHub](https://github.com/) account if you don't already have one. It'll be your code portfolio and this is how you showcase projects on your resume.

## How to break down this phase

I would suggest spending time on these three topics and this timeline:
Expand Down Expand Up @@ -40,38 +44,40 @@ clouduploader /path/to/file.txt

### Steps:

1. Setup & Authentication:
1. Create a GitHub repo for your project, make sure to leverage branches and commit your code often.

2.. Setup & Authentication:

- Choose a cloud provider (e.g., AWS S3, Google Cloud Storage, Azure Blob Storage).
- Setup authentication. For instance, with Azure, you'd use `az login` to set up your credentials.
2. CLI Argument Parsing:
3. CLI Argument Parsing:

- Use bash's built-in `$1`, `$2`, etc., to parse command-line arguments.
- `$1` could be the filename or path.
- Optionally, allow additional arguments like target cloud directory, storage class, or any other cloud-specific attributes.
3. File Check:
4. File Check:

- Before uploading, check if the file exists using `[ -f $FILENAME ]`.
- Provide feedback if the file is not found
4. File Upload:
5. File Upload:

- Use cloud provider CLI to upload the file.

5. Upload Feedback:
6. Upload Feedback:

- On successful upload, provide a success message.
- If there's an error, capture the error message and display it to the user.
6. Advanced Features (Optional):
7. Advanced Features (Optional):

- Allow multiple file uploads at once.
- Add a progress bar or percentage upload completion using tools like `pv`.
- Provide an option to generate and display a shareable link post-upload.
- Enable file synchronization -- if the file already exists in the cloud, prompt the user to overwrite, skip, or rename.
- Integrate encryption for added security before the upload.
7. Documentation:
8. Documentation:

- Write a README.md file that explains how to set up, use, and troubleshoot the tool. Include a brief overview, prerequisites, usage examples, and common issues.
8. Distribution:
9. Distribution:

- Package the script for easy distribution and installation. You can even provide a simple installation script or instructions to add it to the user's `$PATH`.

Expand Down
153 changes: 81 additions & 72 deletions docs/phase2/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Phase 2: Programming, Git, and Prompt Engineering
# Phase 2: Programming

Author: [GPS](https://twitter.com/madebygps)

Expand All @@ -11,11 +11,9 @@ You'll be using code to automate tasks, deploy infrastructure, and work with ser

## What You Need To Learn

There are several programming languages that are popular with Cloud: Go, Rust, .NET, JavaScript. If you know any of these, you can continue using them, if not, since you are a beginner, I would go with [Python](https://www.python.org/). It's a very popular language and there are many quality free resources out there to learn it.
There are several programming languages that are popular with Cloud: Python, Go, Rust, .NET, JavaScript. If you know any of these, you can continue using them, if not, since you are a beginner, I would go with [Python](https://www.python.org/). It's a very popular language and there are many quality free resources out there to learn it.

Along side learning to code, you'll need leverage [Git](https://git-scm.com/). It's the most popular version control tool and one of the DevOps practices. It is used to manage and share your code. GitHub is one of the most popular repository hosting service.

Take some time now to create a [GitHub](https://github.com/) account if you don't already have one. It'll be your code portfolio and this is how you showcase projects on your resume.
Continue adding your projects to your GitHub profile that you created in the past phase.

We also recommend you at this point leverage tools like GitHub Copilot and Prompt Engineering to help you write code more productively.

Expand All @@ -26,8 +24,7 @@ I would suggest spending time on these two topics and this timeline:
| Order | Topic |
|-------|---------------------------------|
| 1 | Learn to Code |
| 2 | Learn Git and GitHub |
| 3 | Learn Prompt Engineering |
| 2 | Learn Prompt Engineering |


## Resources
Expand All @@ -36,71 +33,83 @@ I would suggest spending time on these two topics and this timeline:
| :---- | :--------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| 1 | [Python Crash Course](https://ehmatthes.github.io/pcc/) | A great Python book, also there is an Appendix in there on Git which is great!
1 | [Python for Beginners](https://youtu.be/jFCNu1-Xdsw) | A 44 part video series introducing you to Python |
| 2 | [Complete Git and GitHub course](https://www.youtube.com/watch?v=apGV9Kg7ics) | A video by [Kunal Kushwaha](https://bio.link/kunalk)
| 3 | [ChatGPT Prompt Engineering for Developers](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/) | A course by [deeplearning.ai](https://www.deeplearning.ai/) |
| 3 | [A Beginner's Guide to Prompt Engineering with GitHub Copilot](https://dev.to/github/a-beginners-guide-to-prompt-engineering-with-github-copilot-3ibp) | An article by [Rizèl Scarlett](https://twitter.com/blackgirlbytes) on how to get the most out of GitHub Copilot.|
| 3 | [Introduction to GitHub Copilot](https://learn.microsoft.com/training/modules/introduction-to-github-copilot/) | An Microsoft Learn Module on how to use GitHub Copilot.|

## Capstone Project: PyCloud Deployer

A Python CLI tool that facilitates the deployment of a 2 or 3 tier infrastructure to a cloud provider of the your choice. The tool should provide the option to set up and tear down the infrastructure and return the public IP for SSH access upon successful deployment.

Your tool should be able to run:

- `pycloud-deployer setup --tier 3 --deployment-name <your-deployment-name>`
- `pycloud-deployer info --deployment-name <your-deployment-name>`
- `pycloud-deployer teardown --deployment-name <your-deployment-name>`

### Details:

#### 1\. Infrastructure Overview:

- 2-Tier: Consists of a Web/Application layer and a Database layer.
- 3-Tier: Consists of a Load Balancer, Web/Application layer, and a Database layer.

#### 2\. Functionalities:

- Setup: Deploy the chosen infrastructure to the specified cloud provider.
- Tear Down: Remove the entire deployed infrastructure.
- Get Info: Retrieve information about the deployed infrastructure, especially the public IP for SSH.

#### 3\. Programming:

- Modules: Utilize cloud SDKs/modules (e.g., `boto3` for AWS, `google-cloud` for GCP, `azure` for Azure) to interact with cloud services.
- OOP: Design classes representing each tier of the infrastructure. E.g., `LoadBalancer`, `WebServer`, `DatabaseServer`.
- Control statements: Logic to decide between deploying 2-tier vs 3-tier, checking if infrastructure is already deployed, etc.
- Exceptions: Handle potential cloud errors, such as quota exceedance, service unavailability, etc.
- Dictionaries: Store metadata about each tier, like instance IDs, public IPs, status, etc.

#### 4\. Implementation Steps:

1. Cloud Authentication: Authenticate the CLI tool with the cloud provider using API keys, service account credentials, or equivalent.

2. User Input:

- Take user input to decide on the cloud provider.
- Choose between 2-tier and 3-tier deployment.
- Optionally, accept specific configurations, like region, machine type, etc.
3. Deployment:

- For 2-Tier:
- Deploy a VM or instance for the Web/Application layer.
- Deploy a VM or instance for the Database layer.
- For 3-Tier:
- Deploy a Load Balancer.
- Deploy one or more VMs or instances behind the Load Balancer for the Web/Application layer.
- Deploy a VM or instance for the Database layer.
4. Return Information: After successful deployment, return the public IP (and possibly a private key for initial access if generated) for SSH.


```sh
Infrastructure successfully deployed!
Public IP for SSH: xx.xx.xx.xx
```


5. Tear Down Option: Allow the user to remove the entire setup using the CLI tool.

| 2 | [A Beginner's Guide to Prompt Engineering with GitHub Copilot](https://dev.to/github/a-beginners-guide-to-prompt-engineering-with-github-copilot-3ibp) | An article by [Rizèl Scarlett](https://twitter.com/blackgirlbytes) on how to get the most out of GitHub Copilot.|


## Capstone Project: Serverless Movies API.

Create an API with serverless functions that display movie information.

1. Create your cloud infrastructure with an SDK, you'll need a NoSQL db, cloud storage and serverless function. Depending on which cloud you use, you might need additional things.
2. Find movie data or create it and store it in your cloud NoSQL db.
3. Store movie cover images of each movie in cloud storage.
4. Create 3 functions:
1. **GetMovies:** Returns a JSON list of all movies in your db. Make sure to return a URL for the movie cover.
2. **GetMoviesByYear:** Returns a list of movies released in that year. Year is provided by the client.
3. **EXTRA CREDIT:** GetMovieSummary: Returns a summary that is generated by AI.

Your movie data model could look like:
```json

{
"title":"title of the movie",
"releaseYear":"when the movie was released",
"genre":"genre of the movie",
"coverUrl":"url-to-image-in-cloud-storage"
}
```

GetMovies could look like this:
`yourapi.com/getmovies`
```json
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
},
{
"title": "The Shawshank Redemption",
"releaseYear": "1994",
"genre": "Drama, Crime",
"coverUrl": "https://example.com/shawshank-redemption.jpg"
},
{
"title": "The Dark Knight",
"releaseYear": "2008",
"genre": "Action, Crime, Drama",
"coverUrl": "https://example.com/dark-knight.jpg"
}
]
```

GetMoviesByYear could look like:
`yourapi.com/getmoviesbyyear/2010`
```json
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
}
]
```

GetMovieSummary could look like:
`yourapi.com/getmoviesummary/inception`
```json
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg",
"generatedSummary": "A mind-bending sci-fi thriller about dream theft and manipulation."
}
]
```

## Things you should be familiar with at the end of this phase

Expand Down

0 comments on commit d416320

Please sign in to comment.