Coder Social home page Coder Social logo

Sprint 1 about hog HOT 15 CLOSED

green-coding-solutions avatar green-coding-solutions commented on July 23, 2024
Sprint 1

from hog.

Comments (15)

ribalba avatar ribalba commented on July 23, 2024

@ArneTR I want to collect all bug reports here for power hog v0.2

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

Bug #1 happened while the Hog.app was already on the system and I was following the install instructions from the welcome screen.

First step failes:

curl -fsSL https://raw.githubusercontent.com/green-coding-berlin/hog/main/install.sh | sudo bash
Xcode Command Line Tools are already installed!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6100  100  6100    0     0  14721      0 --:--:-- --:--:-- --:--:-- 14987
Archive:  /tmp/latest_release.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/latest_release.zip or
        /tmp/latest_release.zip.zip, and cannot find /tmp/latest_release.zip.ZIP, period.

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

The problem might be that the unzip operation will unzip also to a folder that is only sudo writeable. Somehere there needs to be a sudo call in the file at least

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

Next up I tried to manually go through the install file one by one to install the hog.

I encountered the sed command, which does not work for me. I have the default BSD sed. The following change was necessary:

sed -i "s|PATH_PLASE_CHANGE|/usr/local/bin/hog/|g" /Library/LaunchDaemons/berlin.green-coding.hog.plist
to
sed -i '' "s|PATH_PLASE_CHANGE|/usr/local/bin/hog/|g" /Library/LaunchDaemons/berlin.green-coding.hog.plist

Otherwise I get sed: 1: "/Library/LaunchDaemons/ ...": invalid command code L

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

Mini Note: Maybe change type from PATH_PLASE_CHANGE to PATH_PLEASE_CHANGE

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

The hog is running. First interesting find: energy_impact and avg cpu time can be greatly differing
Screenshot 2023-09-23 at 1 20 42 AM

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

Bug #3: The settings in my settings file in the HOME directory are not picked up. I did not create a settings file in /usr/local/bin/hog

Screenshot 2023-09-23 at 1 23 55 AM Screenshot 2023-09-23 at 1 25 02 AM

In my firewall I see that the requests actually go out wrongly to the live domain

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

Bug #4: I blocked the request to the online domain and the power logger crashed.
Screenshot 2023-09-23 at 1 26 46 AM

Even after 10 Minutes it is not coming back up. The service is still running, but apparently in an endless loop.

Screenshot 2023-09-23 at 1 32 39 AM Screenshot 2023-09-23 at 1 31 43 AM

If I unload the service I can see again data in the Hog macOS panel. However only until the next data upload is tried and blocked.

In order for you to reproduce it I then tried disabling my Wifi. Here the same issue happens, after 5 Minutes and no Internet the hog power logger crashes

from hog.

ribalba avatar ribalba commented on July 23, 2024

The problem might be that the unzip operation will unzip also to a folder that is only sudo writeable. Somehere there needs to be a sudo call in the file at least

The installer pipes the script to sudo bash

 curl -fsSL https://raw.githubusercontent.com/green-coding-berlin/hog/main/install.sh | sudo bash

should be the command that is show in the hog? Can you please recheck?

The hog is running. First interesting find: energy_impact and avg cpu time can be greatly differing

It could be that it really depends on what core the process is running. Performance cores take up to 10 times more energy. I am currently looking into the cpu_time as something seems to be off anyway.

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

The problem might be that the unzip operation will unzip also to a folder that is only sudo writeable. Somehere there needs to be a sudo call in the file at least

The installer pipes the script to sudo bash

 curl -fsSL https://raw.githubusercontent.com/green-coding-berlin/hog/main/install.sh | sudo bash

should be the command that is show in the hog? Can you please recheck?

The hog is running. First interesting find: energy_impact and avg cpu time can be greatly differing

It could be that it really depends on what core the process is running. Performance cores take up to 10 times more energy. I am currently looking into the cpu_time as something seems to be off anyway.

You see in my CLI paste here that the pipe is as said to sudo bash. I also retried it just now, error is still current.

To answer your follow up question: In the hog it shows correctly as sudo bash also

from hog.

ribalba avatar ribalba commented on July 23, 2024

Can you try:

curl -s https://api.github.com/repos/green-coding-berlin/hog/releases/latest | grep '/hog_power_logger.zip' | cut -d\" -f4

from hog.

ArneTR avatar ArneTR commented on July 23, 2024

from hog.

ribalba avatar ribalba commented on July 23, 2024

Hmmm? Why am I getting

# curl -s https://api.github.com/repos/green-coding-berlin/hog/releases/latest | grep '/hog_power_logger.zip' | cut -d\" -f4
https://github.com/green-coding-berlin/hog/releases/download/0.2/hog_power_logger.zip

it seems like the | is not working. But why?

from hog.

ribalba avatar ribalba commented on July 23, 2024

For the record:
The settings file was not picked up as @ArneTR put it in his home directory but the power_logger script runs as root. The documentation and implementation were not clear here. Fixed

from hog.

ribalba avatar ribalba commented on July 23, 2024

For the record. The curl download was not working as GitHub once in while as an error, that delivers a different version of the json without newlines and the json double.

from hog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.