Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-requisites script #72

Merged
merged 11 commits into from
Jan 26, 2020
Merged

Pre-requisites script #72

merged 11 commits into from
Jan 26, 2020

Conversation

XhorxhinaT
Copy link
Collaborator

@XhorxhinaT XhorxhinaT commented Jan 18, 2020

This script checks if the needed libraries and packages are installed, so our tool can run without errors.

Description

We need to ease the installation of the tool to the user. We are already installing libraries and dependencies and we need to take care of them to facilitate the installation of the user.
We need a script that:

Checks that Google SDK is installed, if not print a link to show where to download it / how to install it. If it is, configure the project written by the user in the config file.
Check if geth and puppeth(docker also needed to be installed) are installed, if not print a link to show how to install it.
Check if jq (used in the SUT script) is installed, if not print a link to show how to install it.
Check if npm is installed. If not print a link how to install it.
Check if caliper is installed under /bin. If not, it will be installed with npm.
Run caliper bind to configure ethereum.
Execute the template creation script #61
If possible in this script, check that the python libraries needed are installed. If possible find an easy way to install these libraries. If it is not possible it should be enough with checking if these are installed or not.

Related Issue

Related to

#30

Types of changes

  • Checks the libraries and packages, if everything is installed or not.

Checklist contributor:

  • The code of the script runs without any errors (error handling correctly used)

  • The code should print clear steps of how to install or at least show a link with clear documentation of how to install what is needed.

  • If everything is installed, show a message that dependencies are fulfilled.

  • If after running the script everything is fulfilled, main.py must be able to run correctly without dependencies errors

This script checks if the needed libraries and packages are installed, so our tool can run without errors.
Copy link
Collaborator

@boxrhcp boxrhcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! Happy you found how to check for python libraries. There are some minor changes to do from the task still :)

prerequisites.sh Outdated Show resolved Hide resolved
prerequisites.sh Outdated Show resolved Hide resolved
prerequisites.sh Outdated Show resolved Hide resolved
I still got to add the path of Template#61 -TODO after I have the script.
Thinking a way to control the final echo when they all are installed (&&)=true
or with (-o) =true
@boxrhcp boxrhcp mentioned this pull request Jan 20, 2020
4 tasks
Copy link
Collaborator

@boxrhcp boxrhcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it prompts a correct message but you left behind what is commented

prerequisites.sh Outdated
fi

echo ""
cd cp_ws_1920/bin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error here! wrong path

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why wrong path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and what comment did i left out? :/

Copy link
Collaborator Author

@XhorxhinaT XhorxhinaT Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boxrhcp wrong path? why is bin not undeer cp_ws

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following errors.
image

bin is under cp_ws but im running the script inside cp_ws folder.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2020-01-22 at 19 50 47

corrected that one thing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boxrhcp gracias

boxrhcp
boxrhcp previously approved these changes Jan 22, 2020
Copy link
Collaborator

@boxrhcp boxrhcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ!

prerequisites.sh Outdated Show resolved Hide resolved
Copy link
Owner

@SantoshDhirwani SantoshDhirwani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now. GJ!

@SantoshDhirwani
Copy link
Owner

@SantoshDhirwani did u merge it after did the change?

No, your branch was behind the master so I just brought it on the same level as master without losing your changes, or else your script would not be able to find my scripts from #61.
You can test this branch now and it should work.

The last ToDo also runs well
Copy link
Collaborator Author

@XhorxhinaT XhorxhinaT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's finished! Approve please @boxrhcp @ulalaa14 @santosh-dhirwani @ankushshr1993

@boxrhcp
Copy link
Collaborator

boxrhcp commented Jan 25, 2020

Did you test it? the script is under /bin not in the base directory and is not checking if it worked or not :/

@XhorxhinaT
Copy link
Collaborator Author

Did you test it? the script is under /bin not in the base directory and is not checking if it worked or not :/

yes i did, santosh part worked, but caaliper didn't, and that comes because the script in my branch ended somehow under bin, which means, I have to refix caliper, or move the script. Your want prereq our of bin right?

prereq.sh is out of bin now and caliper and template should work
@SantoshDhirwani
Copy link
Owner

As a side note: pip install pandas doesn't work for mac (at least it didn't work for me). So my question is that will these pre-requisites work for all types of operating systems? If not, we must mention it clearly in the readme.

@XhorxhinaT
Copy link
Collaborator Author

XhorxhinaT commented Jan 26, 2020

@santosh-dhirwani it looks like it works for me, and I have mac. Maybe you should upgrade your pip or use instead pip3. It depends on the python version u have installed
(base) MAC-UM-265:~ xhorxhina.taraj$ pip install pandas
Requirement already satisfied: pandas in ./opt/anaconda3/lib/python3.7/site-packages (0.25.1)
Requirement already satisfied: python-dateutil>=2.6.1 in ./opt/anaconda3/lib/python3.7/site-packages (from pandas) (2.8.0)
Requirement already satisfied: pytz>=2017.2 in ./opt/anaconda3/lib/python3.7/site-packages (from pandas) (2019.3)
Requirement already satisfied: numpy>=1.13.3 in ./opt/anaconda3/lib/python3.7/site-packages (from pandas) (1.17.2)
Requirement already satisfied: six>=1.5 in ./opt/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas) (1.12.0)

@SantoshDhirwani
Copy link
Owner

Okay, great. I didn't check that on mac because I also switched to working in a VM (Ubuntu) recently.

Copy link
Owner

@SantoshDhirwani SantoshDhirwani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ!

@XhorxhinaT XhorxhinaT merged commit 311e3f0 into master Jan 26, 2020
@XhorxhinaT XhorxhinaT deleted the XhorxhinaT-patch-1 branch February 12, 2020 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
CP_WS_1920
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants