Question
Scott Roth · Aug 22

Containerization Help

I am new to using containers. I am working on trying to specify some of the SAM settings and wondered how to access the terminal while IRIS is running in a Container. Can someone help me out?

Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:13:24 EDT
0
0 171
Discussion (12)2
Log in or sign up to continue

for DOCKER:
docker exec -it [-u root] <container-name or -id>  bash
details

Is there a magic trick to get it to work with VS Code as well? I have configured all the security settings and I am getting a "Forbidden" error when trying to access it via VS Code?

Not sure why would you need to connect SAM container directly, but ok.

As Robert, already mentioned, to open terminal inside the container, you can do this command

docker exec -it {conatiner_id} bash

-i for interactive, -t for tty

-u root, if you would need to get root access, not needed in most of the cases.

bash is for command which you need to execute, so, it can be just

docker exec -it {conatiner_id} iris session IRIS

where the first iris is a command, session command there and last IRIS is an instance name (by default in docker container)

The next question is how to connect with VSCode. So, first of all, it should be connected over internal WebServer, or another way you managed to configure for access web. So, container have to be started with mapped port 52773

You may get authorization issues with a freshly started container, while it may require you to change the password. VSCode requires authorization. So, just simple config should work

{
  "objectscript.conn": {
    "active": true,
    "port": 52773,
    "host":"localhost",
    "username": "_system",
    "password": "SYS",
    "ns": "%SYS",
  }
}

I was looking to connect to the SAM container to add code for custom metrics to SAM for our group. If it isn't a suggested path I could always create the code locally and move it over to the SAM container.

@Scott Roth 
 

The custom metrics code needs to be added to the instances of IRIS that SAM is monitoring, not the SAM Manager IRIS instance itself. The full documentation for adding custom metrics can be found here.

if you have just to place a bunch of lines at OS level from inside IRIS you may try my package
WebCommand If you can operate with irisowner privileges
It's  similar to  ! or $  in normal terminal or console access.   Article on DC
 

If to be honest, I have no idea, of the reasons for appearing SAM in the way it appeared. SAM is a bunch of tools.

  • Grafana, AlertManager - Visualization, and alerting
  • Prometheus - Time-Series Database, which in fact do requests to IRIS to collect metrcis
  • SAM itself, is from what I got, is just an UI tool which helps kind of organize your cluster and configure Prometheus+Grafana. And it uses the whole IRIS just for it.

And in fact SAM is not a requirement for it all. The thing is on your servers, where you have couple of API endpoints for Prometheus. And As far as I remember, the code there is closed, and you can't extend it. But you can easily add, your own endpoints, with your custom metrics, in understandable by Prometheus format. Look a this article as an example

So, any new metrics are supposed to be added in your servers, not in SAM.

And there is another way. Last year I developed a plugin to Grafana itself, which can connect directly to IRIS by its super port, and collect data in any way. So, even like, just without Prometheus at all, just Grafana and IRIS. It's possible to move some metrics logic outside of IRIS. Something like, use SQL query as a metric, or read some global, and visualize it in Grafana. That plugin is just a proof of concept, and can't be used in production. It requires some work on it, but I did not see so much interest in it, yet. And I would really like to improve it and make it useful.

Is there any benefit to just using Prometheus/Grafana vs using the SAM?

SAM is an extra bonus (arguable) to Prometheus/Grafana.

There are no SAM at all without Grafana/Prometheus