Giter Site home page Giter Site logo

Comments (17)

kfdm avatar kfdm commented on September 4, 2024

Sorry for the delayed reply. Where you able to figure out the issue?

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

Uzip lost some files. It's my fault.
and I run pip install -e ./tmp/promgen , lost manage.py, so...

then,
I run pip uninstall promgen, --ok
run pip install -e ./tmp/promgen --ok
But it's still lost some files, it lost
/path/to/virtualenv/lib/python3.6/site-packages/promgen/tests/examples
and
/path/to/virtualenv/lib/python3.6/site-packages/promgen/tests/notifications,
I don't know why..

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

I copy examples and notifications, and
promgen bootstrap --ok
echo 1 > ~/.config/promgen/DEBUG --ok
promgen migrate --ok
promgen test --error

[root@python-rh7 bin]# promgen test
Traceback (most recent call last):
File "/path/to/virtualenv/bin/promgen", line 11, in
load_entry_point('promgen==0.31.dev0', 'console_scripts', 'promgen')()
File "/path/to/virtualenv/lib64/python3.6/site-packages/promgen/manage.py", line 20, in main
execute_from_command_line(sys.argv)
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/core/management/commands/test.py", line 26, in run_from_argv
super().run_from_argv(argv)
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/core/management/base.py", line 308, in run_from_argv
parser = self.create_parser(argv[0], argv[1])
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/core/management/base.py", line 282, in create_parser
self.add_arguments(parser)
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/core/management/commands/test.py", line 47, in add_arguments
test_runner_class = get_runner(settings, self.test_runner)
File "/path/to/virtualenv/lib64/python3.6/site-packages/django/test/utils.py", line 308, in get_runner
test_module = import(test_module_name, {}, {}, test_path[-1])
ModuleNotFoundError: No module named 'django_nose'

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

If I run
promgen runserver 0.0.0.0:8000 --ok
It's can work, but I chick Register Rule button, --error
tell me: No such file or directory: '/usr/local/bin/promtool': '/usr/local/bin/promtool'
mkdir /usr/local/bin/promtool --ok
chmod 777 /usr/local/bin/promtool --ok
chick Register Rule button, --error
Permission denied: '/usr/local/bin/promtool'

I don't know why..
Can you tell me which step is wrong?

from promgen.

kfdm avatar kfdm commented on September 4, 2024

No such file or directory: '/usr/local/bin/promtool

Promgen needs to know the path to promtool so that it can check to see if the rules file is valid before outputing it. This can be configured in promgen.yaml

ModuleNotFoundError: No module named 'django_nose'

To run tests you'll need to install Promgen with the optional test requirements pip install -e .[dev] should work.

As for the lost files, I will try to take a look this week though I'm out of office for most of today.

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

Promgen 192.168.99.100,
prometheus 172.24.148.164
I can't find file ‘promtool’ on 192.168.99.100,
Must I intall Promgen on 172.24.148.164 with prometheus ?

from promgen.

kfdm avatar kfdm commented on September 4, 2024

Part of that is likely a problem with the documentation. I will try to fix that. In the meantime as reference you can see for the docker image, we download a promtool binary so that Promgen can use it directly to confirm the rule syntax

promgen/Dockerfile

Lines 11 to 16 in 78ece81

RUN set -ex; \
apk add --no-cache curl tar; \
curl -L -s $PROMETHEUS_DOWNLOAD_URL \
| tar -xz -C /usr/local/bin --strip-components=1 prometheus-${PROMETHEUS_VERSION}.linux-amd64/promtool; \
apk del curl tar; \
rm -rf /var/cache/apk;

In a similar way, using your preferred deployment tool, download a recent Prometheus release and copy promtool into a location that Promgen can access.

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

Thank you for your answer.
I copy this file from prometheus(172.24.148.164), this problem has been solved.
But have new problem:
When I chick Register Rule button, the page is loading forever, not jump next page.
Mysql table:promgen_rule have a new record which I create on page.
install with docker did not have this problem.

This will happen if you use code: ‘return self.form_invalid(form)’ in views.py .

self.form_invalid(form)
is
<HttpResponseRedirect status_code=302, "text/html; charset=utf-8", url="/rule/2/edit">

install Promgen for a development environment --no jump
install with docker --jump

from promgen.

kfdm avatar kfdm commented on September 4, 2024

Hmm. I'm a little confused why it would be getting stuck with development environment but not docker (usually docker is the difficult one to debug)

Can you verify that promtool is executable ? promtool --version

If promtool is in a different location, you may need to edit ~/.config/promgen/promgen.yml to ensure that Promgen can locate promtool

prometheus:
  # Path to promtool to verify valid rules file
  promtool: /usr/local/bin/promtool

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

[root@i-F7D45611 bin]# /usr/local/bin/promtool --version
promtool, version 2.1.0 (branch: HEAD, revision: 85f23d82a045d103ea7f3c89a91fba4a93e6367a)
build user: root@6e784304d3ff
build date: 20180119-12:01:23
go version: go1.9.2

promgen.yml
promtool: /usr/local/bin/promtool

from promgen.

kfdm avatar kfdm commented on September 4, 2024

Can you post the clause (the Prometheus query part) of the rule you are trying to save?
I'm still a little confused why the docker version would work but the development version would not.
Also could you tell me which file you are downloading Promgen from?

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

The real reason is :
admin--Promgen › Shards › Default --Prometheis--add Host:172.24.148.164 Port:9090
I delete this host, it's work.
add host,it would not.
You can test.

from promgen.

kfdm avatar kfdm commented on September 4, 2024

Have you configured CELERY_BROKER_URL ?
Adding or removing a Prometheus server should not make a difference, but if no CELERY_BROKER_URL is configured, then it could be getting stuck there.

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

Thank you for your answer.
I configured CELERY_BROKER_URL, redis maybe have problems.
There have new problem with gunicorn:
pip install gunicorn --ok,
gunicorn promgen.wsgi:application -w 4 -b 0.0.0.0:8000 --ok
When I visit ip:8000,
Not Found: /static/css/bootstrap.min.css
Not Found: /static/css/promgen.css
Not Found: /static/css/bootstrap-switch.min.css
Not Found: /static/js/jquery.min.js
Not Found: /static/css/bootstrap-theme.min.css
Not Found: /static/css/bootstrap-datetimepicker.min.css
Not Found: /static/js/jquery.selection.js
Not Found: /static/js/moment.min.js
Not Found: /static/js/bootstrap3-typeahead.min.js
Not Found: /static/js/bootstrap.min.js
Not Found: /static/js/bootstrap-datetimepicker.min.js
Not Found: /static/js/bootstrap-switch.min.js
Not Found: /static/js/promgen.js
Not Found: /static/js/bootstrap3-typeahead.min.js
Not Found: /static/js/moment.min.js
Not Found: /static/js/bootstrap-datetimepicker.min.js
Not Found: /static/js/bootstrap-switch.min.js
Not Found: /static/js/promgen.js

Can you tell me which step is wrong?
Or I lost some steps?

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

I run SECRET_KEY=1 promgen collectstatic:
'''
Copying '/path/to/virtualenv/lib64/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js'
Copying '/path/to/virtualenv/lib64/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.min.js'
Copying '/usr/src/app/promgen/static/css/bootstrap-datetimepicker-standalone.css'
Copying '/usr/src/app/promgen/static/css/bootstrap-datetimepicker.min.css'
Copying '/usr/src/app/promgen/static/css/bootstrap-switch.min.css'
Copying '/usr/src/app/promgen/static/css/bootstrap-theme.min.css'
Copying '/usr/src/app/promgen/static/css/bootstrap-theme.min.css.map'
Copying '/usr/src/app/promgen/static/css/bootstrap.min.css'
Copying '/usr/src/app/promgen/static/css/bootstrap.min.css.map'
Copying '/usr/src/app/promgen/static/css/promgen.css'
Copying '/usr/src/app/promgen/static/fonts/glyphicons-halflings-regular.eot'
Copying '/usr/src/app/promgen/static/fonts/glyphicons-halflings-regular.svg'
Copying '/usr/src/app/promgen/static/fonts/glyphicons-halflings-regular.ttf'
Copying '/usr/src/app/promgen/static/fonts/glyphicons-halflings-regular.woff'
Copying '/usr/src/app/promgen/static/fonts/glyphicons-halflings-regular.woff2'
Copying '/usr/src/app/promgen/static/js/bootstrap-datetimepicker.min.js'
Copying '/usr/src/app/promgen/static/js/bootstrap-switch.min.js'
Copying '/usr/src/app/promgen/static/js/bootstrap.min.js'
Copying '/usr/src/app/promgen/static/js/bootstrap3-typeahead.min.js'
Copying '/usr/src/app/promgen/static/js/jquery.min.js'
Copying '/usr/src/app/promgen/static/js/jquery.selection.js'
Copying '/usr/src/app/promgen/static/js/locales.min.js'
Copying '/usr/src/app/promgen/static/js/moment-with-locales.min.js'
Copying '/usr/src/app/promgen/static/js/moment.min.js'
Copying '/usr/src/app/promgen/static/js/promgen.js'

141 static files copied to '/root/.cache/promgen'.

(virtualenv) [root@i-AE133268 app]# cd /root/.cache/promgen/
(virtualenv) [root@i-AE133268 promgen]# ll
total 12
drwxr-xr-x 6 root root 47 Nov 14 14:32 admin
drwxr-xr-x 2 root root 4096 Nov 14 14:32 css
drwxr-xr-x 2 root root 4096 Nov 14 14:32 fonts
drwxr-xr-x 2 root root 4096 Nov 14 14:32 js

It's still has no work.

from promgen.

kfdm avatar kfdm commented on September 4, 2024

I'm still having a bit of difficulty understanding what component is not working. Is this still a problem with writing and saving a rule or is this a different problem.

If this is a probably with the rule editor, can you paste the Prometheus query you are trying to save (perhaps take a screenshot of the entire page) and any errors that show up in the console from Promgen's server.

from promgen.

jiaodou avatar jiaodou commented on September 4, 2024

Is whitenoise version, docker is 3.3.1 ,development environment is 4.1.1,I switch to 3.3.1 ,is't work.

from promgen.

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.