In this Lab session, you will be asked to put into practice the basic knowledge required for the Lab sessions of this course.
Take a look at the following hands-on guides to check if you already have the basic knowledge to follow this course. If not, please do the assignments.
- Hands-on 0: Run a Linux OS in a Virtual Machine (Only required for Windows users)
- Hands-on 1: Git and GitHub Quick Start
- Hands-on 2: Markdown syntax
- Hands-on 3: Python Quick Start
- Hands-on 4: Python Development Environment Quick Start
Create an AWS account and install AWS CLI following the following hands-on:
- Hands-on 5: Getting Started in the Cloud with AWS
Install Python on your laptop.
For these lab sessions we advice you to create a new anaconda environment using the bare minimum amount of Python packages. You will be adding more packages as you need them later.
Once the new environment is set you can hover and see the path where the python interpreter and the packages have been installed.
You can also open a terminal and examine your new environment.
Using the Anaconda terminal, some unix commands also work in MS-Windows:
(CCBDA_UPC) C:\prompt> which python
/cygdrive/c/Anaconda/envs/CCBDA_UPC/python
That answer means that your python interpreter is at c:\Anaconda\envs\CCBDA_UPC\python
. You will get a similar response if you are using a unix OS.
If you need to use the commands from that new environment you must make sure that the PATH
variable (both windows and unix) contains the directory. To update that variable for windows. If your environment has a different name or it has been created in a different path change the command accordingly.
SET PATH=%PATH%;c:\Anaconda\envs\CCBDA_UPC;c:\Anaconda\envs\CCBDA_UPC\Scripts;
PyCharm is a very popular IDE that will make your life much easier. It supports execution and debugging of Python, Python environments, code version control, it has a built-in terminal and all kinds of plugins. Moreover, it is completely free for students.
Create a python code that uses the “random” library. Build a program in python that generates a random number between 1 and 20. Then let the player guess the number entered, displaying if the number is too low or high. The game ends either when the number is guessed correctly. The suggested program name is Lab1.guessnumber.py
.
If you are using PyCharm try to become familiar with the integrated debugger. You will need to debug your code in future sessions. On the top-right part of the IDE:
Create a new configuration to run each Python Script:
Just to become familiar with the IDE, set some break points and examine the variables.
Create a private repository
CLOUD-COMPUTING-CLASS-2019 in your GitHub account. Use your student email account (".upc.edu") to create your GitHub account to benefit from private repositories and other perks of the student pack.
Create a global folder with a sub-folder for each lab session similarly as shown below:
Update your remote repository from the local repository on your laptop:
echo "# CLOUD-COMPUTING-CLASS-2019" >> README.md
git init
git add README.md
git add Lab1/Lab1.guessnumber.py
git commit -m "first commit"
git remote add origin https://github.com/<username>/CLOUD-COMPUTING-CLASS-2019.git
git push -u origin master
change
<username>
for your Github account
It is better that you manage git by hand. Once you become familiar with git you can use PyCharm to save you some typing.
Update the README.md
file including all the information about your group (member's name and email addresses).
Invite angeltoribio-UPC-BCN
to your remote private repository as a collaborator using the settings
button (for evaluation purpose).
Create an EC2 instance at AWS. Login and pull down all the contents of your GitHub repository to make an exact clone by using git clone
command.
Execute the program Lab1.guessnumber.py
in your AWS instance. Take a screenshot of the terminal window that are you using as proof.
Include that screenshot in your local repository, on your laptop, with the name Lab1.AWSterminal.png
.
Update your remote GitHub repository with the updated README.md
and the new file Lab1.AWSterminal.png
using the git
commands add
, commit
and push
.
Create an S3 bucket and synchronize your repository there. Take a screenshot of the browser window showing your S3 bucket. Include that screenshot in your local repository, on your laptop, with the name Lab1.S3Bucket.png
.
Questions: How long have you been working on this session? What have been the main difficulties you have faced and how have you solved them? Add your answers to README.md
.
Submit before the deadline to the RACO Practicals section a "Lab1.txt" file including:
- Group number
- Name and email of the members of this group
- GitHub URL that contains your lab answers
- Add any comment that you consider necessary