Code Monkey home page Code Monkey logo

trackit2-home's Introduction

TrackIt helps you to optimize your AWS cloud

Trackit

This is a tool written in go to optimize your AWS usage and spending.

This repository contains the deployment tools to run TrackIt easily on your own infrastructure.

v2 cost breakdown

Don’t want to self-host trackit?

We run our own version, check it out at TrackIt

Repository structure

Installation

#0 Be sure all requirements below are met

Here is the access your AWS IAM credentials will need to run correctly TrackIt

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AssumeRole",
            "Effect": "Allow",
            "Action": "sts:AssumeRole",
            "Resource": "*"
        }
    ]
}

#1 Clone this repository

$> git clone https://github.com/trackit/trackit && cd trackit

#2 Configure the API_URL

If you are not running TrackIt on your local machine, you need to configure the URL of the API:

$> vi docker-compose.yml
line 8: - API_URL=http://localhost:8080 # replace localhost by the public API of the host

#3 Start TrackIt

$> ./start.sh

Configuring

More information about configuring TrackIt? Check our step-by-step guide here

trackit2-home's People

Contributors

giubil avatar lfrancois avatar schubev avatar simonmeyerrr avatar thibautcornolti avatar zanchi-r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

trackit2-home's Issues

could not validate role and external ID

I was able to install using start.sh script and able to login in to the console. When I tried to add a new aws account I keep getting this error "could not validate role and external ID".

I followed the step by step guide and aws able to create the required Roles and added permissions to it.

api_1  | {"level":"info","time":"2019-02-27T19:54:39.065953885Z","message":"Received request.","data":{"protocol":"HTTP/1.1","method":"OPTIONS","url":"/aws","address":"172.21.0.18:60171","host":"192.168.1.181:8080","userAgent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"],"time":"2019-02-27T19:54:39.06590349Z"},"context":{"requestId":"841a36b1-3ac9-11e9-9fe3-02420a135405"}}
api_1  | {"level":"info","time":"2019-02-27T19:54:39.066105714Z","message":"Produced response to request.","data":{"status":200,"nanoseconds":200834},"context":{"requestId":"841a36b1-3ac9-11e9-9fe3-02420a135405"}}
api_1  | {"level":"info","time":"2019-02-27T19:54:39.117441954Z","message":"Received request.","data":{"protocol":"HTTP/1.1","method":"POST","url":"/aws","address":"172.21.0.18:60171","host":"192.168.1.181:8080","userAgent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"],"time":"2019-02-27T19:54:39.117438397Z"},"context":{"requestId":"8422132c-3ac9-11e9-9fe3-02420a135405"}}
api_1  | AccessDenied: Access denied
api_1  |        status code: 403, request id: 842f4a41-3ac9-11e9-b2fd-3bcf1937e9c5{"level":"info","time":"2019-02-27T19:54:39.233619989Z","message":"Produced response to request.","data":{"status":400,"nanoseconds":116179042},"context":{"requestId":"8422132c-3ac9-11e9-9fe3-02420a135405"}}
api_1  | {"level":"info","time":"2019-02-27T19:54:40.579618289Z","message":"Received request.","data":{"protocol":"HTTP/1.1","method":"POST","url":"/aws","address":"172.21.0.18:60171","host":"192.168.1.181:8080","userAgent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"],"time":"2019-02-27T19:54:40.579615223Z"},"context":{"requestId":"85012e5f-3ac9-11e9-9fe3-02420a135405"}}
api_1  | AccessDenied: Access denied
api_1  |        status code: 403, request id: 8502c7db-3ac9-11e9-b2fd-3bcf1937e9c5{"level":"info","time":"2019-02-27T19:54:40.609692796Z","message":"Produced response to request.","data":{"status":400,"nanoseconds":30075013},"context":{"requestId":"85012e5f-3ac9-11e9-9fe3-02420a135405"}}
api_1  | {"level":"debug","time":"2019-02-27T19:54:48.262207408Z","message":"Started transaction."}
api_1  | {"level":"debug","time":"2019-02-27T19:54:48.264270167Z","message":"Commited transaction."}

start.sh script doesn't test return values

Hi @zanchi-r !

Your startup.sh doesn't test if it goes well or not before to say it. Can you fix it please?

./trackit2/scripts/awsenv default docker-compose up -d
echo "===> installation completed, TrackIt is now running on port 80"

Also trying to understand why you need aws-cli. Can you clarify please?

Service 'sql' failed to build

hi,

did everything as described in docs (executed start.sh); the following error occured.

ERROR: Service 'sql' failed to build: COPY failed: stat /opt/docker/tmp/docker-builder100241954/db/schema.sql: no such file or directory

System:
Docker version 18.04.0-ce, build 3d479c0
docker-compose version 1.21.0, build 5920eb0
on a cent os 7 (latest).
I also tried it with stable ce version - same outcome.

Thank you in advance.

Unable to register in trackit

I have set up the complete UI using the docker and its up and running. Now that I am trying to register the same but unable to.

when I try to register, I get an error as "An error has occurred".

Not sure what wrong can someone help me out to get the UI up and running.

start.sh script needs access to awscli credentials - what type of access?

What type of permission do we need to get the system up and running? I didn't find anything about it in the documentation.

===> starting trackit
Traceback (most recent call last):
  File "./trackit2/scripts/awsenv", line 31, in <module>
    main(profile, cmd)
  File "./trackit2/scripts/awsenv", line 16, in main
    profile_config = get_profile_config(profile)
  File "./trackit2/scripts/awsenv", line 13, in get_profile_config
    return c[profile]
  File "/usr/lib/python3.5/configparser.py", line 956, in __getitem__
    raise KeyError(key)
KeyError: 'default'

README - we don't specify how we connect to the system and how to load a new key

as soon as everything is up and running, we should specify what are the next steps in the README file to complete the setup.

root@ip-10-151-142-104:~/trackit# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:9200          0.0.0.0:*               LISTEN      23479/docker-proxy
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1314/sshd       
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      23399/docker-proxy
tcp6       0      0 :::8080                 :::*                    LISTEN      23757/docker-proxy
tcp6       0      0 :::80                   :::*                    LISTEN      23533/docker-proxy
tcp6       0      0 :::22                   :::*                    LISTEN      1314/sshd       
tcp6       0      0 :::443                  :::*                    LISTEN      23515/docker-proxy
root@ip-10-151-142-104:~/trackit#```

Unable to add new AWS account

Hi,
Just did a fresh installation reached on account configuration page. after step 3 of adding S3 bucket path as soon as I enter done, without any notification popup bar disappears and account does not get added .
Even though the s3 bucket format is validated in input box, it does not add the bucket info.
Does the AWS billing file should be unzip ?
Any help will be much appreciated.

Could not register AWS AccessKeyId and SecretKey

Following the instructions at https://trackit.io/installing-trackit-on-aws-ec2-step-by-step/
Except,

  1. i could only use Redhat Enterprise Linux Server release 7.4
  2. i used $sudo usermod -a -G docker ec2-user

The application comes up ok, and i am able to login as admin/admin
but could not register the aws keys. After i press the Submit button, it turns grey but never returns me to the main page of application.

docker status:

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
70a6530c95ab trackit_loadbalancer "nginx -g 'daemon ..." About an hour ago Up About an hour 0.0.0.0:80->80/tcp, 443/tcp trackit_loadbalancer_1
be2450da969b msolution/trackit_api:latest "/usr/bin/supervisord" About an hour ago Up About an hour trackit_api_1
03c73556266e msolution/trackit_ui:latest "/bin/sh -c ./serv..." About an hour ago Up About an hour 80/tcp trackit_webui_1
2f5864ff5c36 mariadb:latest "docker-entrypoint..." About an hour ago Up About an hour 3306/tcp trackit_mysql_1
a60b1c336d72 redis "docker-entrypoint..." About an hour ago Up About an hour 6379/tcp trackit_redis_1
51143aae3f0a elasticsearch:2.3.5 "/docker-entrypoin..." About an hour ago Up About an hour 9200/tcp, 9300/tcp trackit_es1_1

logs:

$docker logs -f trackit_loadbalancer_1

10.109.227.75 - - [24/Nov/2017:20:49:44 +0000] "POST /api/aws/accounts HTTP/1.1" 401 28 "http://10.193.206.13/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" "-"

$ docker logs -f trackit_api_1

File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1601, in _do_rollback
self.connection._rollback_impl()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 670, in _rollback_impl
self._handle_dbapi_exception(e, None, None, None, None)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 668, in _rollback_impl
self.engine.dialect.do_rollback(self.connection)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/dialects/mysql/base.py", line 2526, in do_rollback
dbapi_connection.rollback()
OperationalError: (_mysql_exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query')

2017-11-24 21:52:44,200 DEBG 'worker' stderr output:
[2017-11-24 21:52:44,200: ERROR/MainProcess] Task app.tasks.fetchs3pricing[6b0cd3d0-dfaf-44e6-826b-5f43a25af0f9] raised unexpected: ConnectionError(MaxRetryError('None: Max retries exceeded with url: /offers/v1.0/aws/AmazonS3/current/index.json (Caused by None)',),)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(args, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 438, in _protected_call
return self.run(args, *kwargs)
File "/root/api/app/tasks.py", line 297, in fetch_s3pricing
s3pricing.fetch()
File "/root/api/app/s3pricing.py", line 25, in fetch
return aws_pricing.fetch('AmazonS3')
File "/root/api/app/aws/pricing.py", line 21, in fetch
res = requests.get(PRICING_URL_TPL % offer, headers=headers)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 67, in get
return request('get', url, params=params, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, *send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 437, in send
raise ConnectionError(e, request=request)
ConnectionError: None: Max retries exceeded with url: /offers/v1.0/aws/AmazonS3/current/index.json (Caused by None)

$ docker logs -f trackit_redis_1

1:M 24 Nov 20:35:37.590 # Server initialized
1:M 24 Nov 20:35:37.590 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 24 Nov 20:35:37.590 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 24 Nov 20:35:37.590 * Ready to accept connections
1:M 24 Nov 21:05:46.165 * 100 changes in 300 seconds. Saving...
1:M 24 Nov 21:05:46.166 * Background saving started by pid 16
16:C 24 Nov 21:05:46.172 * DB saved on disk
16:C 24 Nov 21:05:46.172 * RDB: 6 MB of memory used by copy-on-write
1:M 24 Nov 21:05:46.266 * Background saving terminated with success
1:M 24 Nov 21:35:46.146 * 100 changes in 300 seconds. Saving...
1:M 24 Nov 21:35:46.146 * Background saving started by pid 17
17:C 24 Nov 21:35:46.149 * DB saved on disk
17:C 24 Nov 21:35:46.150 * RDB: 6 MB of memory used by copy-on-write
1:M 24 Nov 21:35:46.246 * Background saving terminated with success

Intermittently, i also get.
There was a problem with the API. Please try signing out and in again.

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.