OvalMoney / celery-exporter

Prometheus metrics exporter for Celery
MIT License
142 stars 37 forks source link

Unable to build the Docker image #10

Closed Poil closed 5 years ago

Poil commented 5 years ago

Hi,

Not sure why, seems to be related to this issue https://github.com/rust-lang/cargo/issues/7154 but Rust is unknown to me ...

Processing /src
Collecting click>=7celery>=4 (from celery-exporter==1.4.0)
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
  Saved ./Click-7.0-py2.py3-none-any.whl
Collecting prometheus_client>=0.0.20 (from celery-exporter==1.4.0)
  Downloading https://files.pythonhosted.org/packages/b3/23/41a5a24b502d35a4ad50a5bb7202a5e1d9a0364d0c12f56db3dbf7aca76d/prometheus_client-0.7.1.tar.gz
Skipping click, due to already being wheel.
Building wheels for collected packages: celery-exporter, prometheus-client
  Building wheel for celery-exporter (setup.py): started
  Building wheel for celery-exporter (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-xnhwanae/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-xnhwanae/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-eo1o88hj
       cwd: /tmp/pip-req-build-xnhwanae/
  Complete output (52 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/celery_exporter
  copying celery_exporter/__init__.py -> build/lib/celery_exporter
  copying celery_exporter/__main__.py -> build/lib/celery_exporter
  copying celery_exporter/core.py -> build/lib/celery_exporter
  copying celery_exporter/metrics.py -> build/lib/celery_exporter
  copying celery_exporter/monitor.py -> build/lib/celery_exporter
  copying celery_exporter/utils.py -> build/lib/celery_exporter
  running build_ext
  running build_rust
      Updating crates.io index
   Downloading crates ...
    Downloaded version_check v0.1.5
    Downloaded regex v1.1.9
    Downloaded autocfg v0.1.4
    Downloaded lazy_static v1.3.0
    Downloaded aho-corasick v0.7.4
    Downloaded memchr v2.2.1
    Downloaded utf8-ranges v1.0.3
    Downloaded proc-macro-hack v0.4.1
    Downloaded pyo3 v0.7.0
    Downloaded proc-macro-hack-impl v0.4.1
    Downloaded inventory v0.1.3
    Downloaded mashup v0.1.9
    Downloaded quote v0.6.12
    Downloaded ghost v0.1.0
    Downloaded pyo3cls v0.7.0
    Downloaded ctor v0.1.9
    Downloaded regex-syntax v0.6.8
    Downloaded inventory-impl v0.1.3
    Downloaded hashbrown v0.1.8
    Downloaded num-traits v0.2.8
    Downloaded lru v0.1.15
    Downloaded proc-macro2 v0.4.30
    Downloaded thread_local v0.3.6
    Downloaded syn v0.15.39
    Downloaded mashup-impl v0.1.9
    Downloaded libc v0.2.59
    Downloaded byteorder v1.3.2
    Downloaded pyo3-derive-backend v0.7.0
    Downloaded unicode-xid v0.1.0
    Downloaded scopeguard v0.3.3
    Downloaded spin v0.5.0
    Downloaded ucd-util v0.1.3
  cargo rustc --lib --manifest-path Cargo.toml --features pyo3/extension-module pyo3/python3 --release --verbose -- --crate-type cdylib
  error: cannot produce cdylib for `celery_state v0.1.0 (/tmp/pip-req-build-xnhwanae)` as the target `x86_64-unknown-linux-musl` does not support these crate types
  error: cargo failed with code: 101

Best regards,

ufou commented 5 years ago

just in case you didn't already know, there is an available docker image: https://hub.docker.com/r/ovalmoney/celery-exporter

Poil commented 5 years ago

Hi,

I know but it's a bad practice to use premade image, you don't have any control on what is inside (Yeah I still have no control over the code but it's better than nothing), and I want to be able to rebuild automatically on detected CVE

Best regards,

MRoci commented 5 years ago

As far as i know Cargo doesn't support using musl c as a dynamic lib (which is required to build a cdylib crate). I you could look at the Dockerfile in this repo for building this crate on Alpine using glibc

EDIT: i'm facing the same issue, i'll take a look into it asap