Coder Social home page Coder Social logo

Comments (6)

seanvaleo avatar seanvaleo commented on July 20, 2024

Scenario: running the rules --add command on the host, targeting processes on the host and child containers

No config supplied

  • rules file correct (matches default)
  • attached procs on host correct (matches default)
  • attached procs in containers correct (matches default)

Pipe a config file to stdin

  • rules file correct (matches piped in config)
  • attached procs on host correct (matches piped in config)
  • attached procs in containers correct (matches piped in config)

Pass a path to a config file to --userconfig [file]

  • rules file correct (matches provided config)
  • attached procs on host correct (matches provided config)
  • attached procs in containers correct (matches provided config)

Use flags to set things like metricdest, eventdest, etc.

  • rules file correct (matches supplied args)
  • attached procs on host correct (matches supplied args)
  • attached procs in containers correct (matches supplied args)

from appscope.

seanvaleo avatar seanvaleo commented on July 20, 2024

after performing a scope inspect, the config in the attached processes do not match the rules file.
repro:

top
sudo ./scope rules --add top # attaches to top and installs scope_rules file
scope inspect # see incorrect config (not the default config)
sudo scope rules # see correct config (default config)

we are putting a config in the rules session directory and the contents are correct
we are adding SCOPE_CONF_PATH to env and it is set to the correct path

it's expected that the loader can see the env var, then writes all SCOPE_ env vars to shared memory, then the constructor reads it on attach.

  • is the loader cmdAttach seeing this env var?
  • is the library constructor seeing this env var?

from appscope.

seanvaleo avatar seanvaleo commented on July 20, 2024

something strange is happening.
if i run top then sudo ./scope attach top, the config looks correct (default config).
but when i follow the steps in the previous comment (which is essentially doing the same thing; attaching to top), the config is wrong

from appscope.

seanvaleo avatar seanvaleo commented on July 20, 2024

i noticed that when attach is run, we create a session directory in /tmp, then create a symlink from /root/.scope/history to that.
i noticed that when rules is run, we create a session directory in the /root/.scope/history dir directly.
in both cases, the config in those directories is accurate. but it is not getting read into the process in the rules case.
is this something to do with it?

i can imagine that the top process cannot get permission to read the config file from the root directory.

from appscope.

seanvaleo avatar seanvaleo commented on July 20, 2024

ok, for the rules command i now create a /tmp directory and then create a symlink from /root/.scope/history to that.
this solved the problem of config not getting respected on attach.
PR: #1569

from appscope.

seanvaleo avatar seanvaleo commented on July 20, 2024

Scenario: running the rules --add command on in a container, targeting processes on the host and child containers

No config supplied

  • rules file correct (matches default)
  • attached procs on host correct (matches default)
  • attached procs in containers correct (matches default)

Pipe a config file to stdin

  • rules file correct (matches piped in config)
  • attached procs on host correct (matches piped in config)
  • attached procs in containers correct (matches piped in config)

Pass a path to a config file to --userconfig [file]

  • rules file correct (matches provided config)
  • attached procs on host correct (matches provided config)
  • attached procs in containers correct (matches provided config)

Use flags to set things like metricdest, eventdest, etc.

  • rules file correct (matches supplied args)
  • attached procs on host correct (matches supplied args)
  • attached procs in containers correct (matches supplied args)

from appscope.

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.