Code Monkey home page Code Monkey logo

Comments (3)

cmoussa1 avatar cmoussa1 commented on August 11, 2024

the dependencies for flux-accounting need to be linked in order for the subcommands to work. My hack was to run pip3 install -r requirements.txt --user again, but maybe there is another way to do this in the Dockerfile while the image is being built?

Okay, I think I was able to solve the No module named 'pandas' error by installing the dependencies to /usr/local/lib64/python3.6/site-packages/ instead of --user, which I think was installing them to root/.local/.

Old pip3 command in Dockerfile:

$ pip3 install -r requirements.txt --user

New pip3 command in Dockerfile:

$ pip3 install -r requirements.txt -t /usr/local/lib64/python3.6/site-packages/

from flux-accounting.

cmoussa1 avatar cmoussa1 commented on August 11, 2024

Here is the final Dockerfile that I sent out to the stakeholders to interact with:

FROM grondo/fluxorama:latest

LABEL maintainer="Christopher Moussa <[email protected]>"

COPY . /usr/lib64/flux-accounting/

RUN yum -y update \
  && yum install -y python3-pip python3-devel git \
  && cd /usr/local/bin \
  && ln -s /usr/bin/python3 python \
  && pip3 install --user --upgrade pip \
  && pip3 install tox

# go into flux-accounting, install dependencies, and run unit tests
RUN cd /usr/lib64/flux-accounting/ \
  && pip3 install -r requirements.txt -t /usr/local/lib64/python3.6/site-packages/ \
  && make install \
  && make check

# load job-archive module
RUN printf "#!/bin/bash\nflux module load job-archive dbpath=/var/lib/flux/jobs.db\n" \
        >/etc/flux/rc1.d/job-archive \
  && chmod +x /etc/flux/rc1.d/job-archive

# make directory for flux-accounting database
RUN mkdir /var/lib/flux-ba

# create flux-accounting database where fluxuser is the "admin"
RUN cd /usr/lib64/flux-accounting/accounting/ \
  && ./create_db.py -p /var/lib/flux-ba/FluxAccounting.db \
  && chown -R fluxuser /var/lib/flux-ba/

# load job-archive module
RUN printf "#!/bin/bash\nflux module load job-archive dbpath=/var/lib/flux/jobs.db\n" \
        >/etc/flux/rc1.d/job-archive \
  && chmod +x /etc/flux/rc1.d/job-archive

This loads the job-archive module and create a database to store inactive jobs. When they are placed here, the database is preserved across restarts and can be accessed with SQLite queries. Flux will not launch successfully if the job-archive module is not executable.

Inside of /var/lib/, a new directory gets created called flux-ba that will hold the flux-accounting database. This database is also preserved across restarts, and can also be accessed with SQLite queries as well as with the flux account subcommands.

I think the caveat for read/write access to the SQLite databases is the same permissions should also be reflected in the directory the database file is located in, i.e. the user must also have permissions to the directory the .db file is in [1], so that's something I would need to look out for.

from flux-accounting.

cmoussa1 avatar cmoussa1 commented on August 11, 2024

I am going to close this issue since I have a working Dockerfile to create an interactive Docker container with flux-accounting and the job-archive DB installed.

from flux-accounting.

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.