Pesquisar

文章
· 十月 8, 2024 阅读大约需 8 分钟

eBPF - Cilium on FHIR® - Uma história Star Wars

 

Anakin Skywalker desafiou o alto terreno e foi terrivelmente ferido em Mustafar.  

 Ele é um funcionário relativamente novo do Império Galáctico, coberto por um Grande Plano de Grupo Planetário e agora tem um encontro ativo em andamento para serviços médicos emergentes na Grande Instalação Médica em Coruscant. O EMR implantado para o Sistema de Saúde Galáctico é alimentado pelo InterSystems FHIR Server rodando em Kubernetes protegido por Cilium.
 

Vamos recriar o cenário técnico, a ser executado no estilo de Isovalent Labs...

Kind Cluster

Vamos iniciar um cluster de 3 nós e desativar o CNI para que possamos substituí-lo pelo Cilium.

cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker
  - role: worker
networking:
  disableDefaultCNI: true
EOF

Isso provisionará o cluster kind, 3 nós de largura com um único plano de controle.


Cilium

Cilium é um projeto de código aberto que fornece rede, segurança e observabilidade para ambientes conteinerizados como clusters Kubernetes. Ele usa uma tecnologia do kernel Linux chamada eBPF (extended Berkeley Packet Filter) para injetar lógicas de segurança, rede e observabilidade no kernel.

Em outras palavras, empunha a força.

cilium install --version v1.16.0
cilium status --wait


Hubble

Hubble é um traje de palhaço para Cilium, fornecendo visibilidade ridícula sobre quais poderes do Cilium estão em jogo em tempo real.

cilium enable hubble

 

 

Carga de trabalho InterSystems FHIR

InterSystems é o GOAT da interoperabilidade e transforma dados de saúde como um droide de protocolo.

kubectl apply -f https://raw.githubusercontent.com/sween/basenube/main/scenarios/ciliumfhir/deploy/cilium-fhir-starwars.yaml

A carga de trabalho resultante tem 4 implantações:

GrandMedicalFacility

Rede Integrada de Assistência Médica com sede em Coruscant, com instalações até o Bordo Exterior, utiliza o Epic e emprega o InterSystems I4H como um servidor FHIR.

MedicalDroid FX-6

Este droide de 1,83 metro de altura forneceu a Vader uma transfusão de sangue e treinou em procedimentos de pernas cibernéticas.

MedicalDroid DD-13

Também conhecido como DD-13 tripedal medical droid, este droide possui três pernas para estabilidade e foi projetado para instalar implantes cibernéticos.

MedicalDroid 2-1B

Os droides 2-1B possuem injetores hipodérmicos e pinças de servogrip fabricadas com precisão, e podem ser atualizados para se especializar em áreas como substituição de membros cibernéticos, neurocirurgia e biologia alienígena.

Como precisaremos disso de qualquer forma para as próximas entrevistas, vamos contar a história na verdadeira metodologia STAR (Situação, Tarefa, Ação, Resultado).

Sith-uation

Palpatine acompanhou o jedi caído para a instalação e, ao chegar, ajudou o registro a admiti-lo como Darth Vader.

cat > vader.json << 'EOF'
{
  "name": [
    {
      "use": "official",
      "family": "Vader",
      "given": [
        "Darth"
      ]
    }
  ],
  "gender": "male",
  "id": "DarthVader",
  "birthDate": "1977-05-25",
  "resourceType": "Patient"
}
EOF
curl -v -X PUT \
  -H "Content-Type: application/fhir+json" \
  -d @vader.json \
  "http://coruscanthealth:52773/intersystems/fhir/r5/Patient/DarthVader"

Darth Vader está agora registrado e pode ser visto em todo o sistema de saúde...

Pane de TI Galáctica

No entanto, tem um problema!

Pouco após o registro, ocorreu uma interrupção de TI galáctica, deixando o provedor de identidade do sistema de saúde indisponível. O servidor de recursos FHIR do InterSystems está habilitado para SMART, e o IDP está configurado, tornando o lançamento do EMR impossível na ausência do token JWT com os escopos aplicáveis para proteger as rotas..


[Nota do tradutor: segue tradução da imagem]

Palpatine: Tem um minuto?

Sween: Eu não estou de plantão, estou na casa dos 50, pelo amor dos Siths!

Palpatine: Todo mundo está me ignorando, e eu tenho um Jedi caído precisando desesperadamente de ajuda, e a equipe de cuidados está tendo problemas para acessar o Repositório FHIR do InterSystems devido a uma interrupção no provedor de identidade.

Sween: Você tem um JIRA para esse problema?

Palpatine: Não, mas eu posso atirar raios das minhas mãos.

Sween: Relaxa boomer, eu vou dar uma olhada.

 

Com certeza, temos um problema... a equipe de cuidados não consegue acessar o prontuário do paciente, só recebem códigos 401 e 403, e não estamos falando sobre seu Plano de Aposentadoria Galáctico.

Embora a interface do Hubble só forneça uma pista do que está acontecendo, inspecionar os fluxos do Hubble com informações da Camada 7 revela a situação.




...e após adicionar alguns debugs bunny ao endpoint FHIR do InterSystems, confirma isso.

 
FHIR Debug
zw^FSLOG
...
^FSLOG(379555)="DispatchRequest^HS.FHIRServer.Service^944|Msg|Dispatch interaction read for Patient/DarthVader|09/19/2024 10:48:20.833339AM"
^FSLOG(379556)="DispatchRequest^HS.FHIRServer.Service^944|Msg|Request Completed in .000186 secs: Patient/DarthVader|09/19/2024 10:48:20.833450AM"
^FSLOG(379557)="processRequest^HS.FHIRServer.RestHandler^944|Msg|Response Status: 401, Json: Patient|09/19/2024 10:48:20.833454AM"
...


Tarefa

What's a great line from Star Wars that doesn't get quoted enough? :  r/StarWarsCantina

[Nota do tradutor: tradução da imagem abaixo]

"Algumas vezes devemos deixar de lado o orgulho e fazer o que nos é requisitado." - Anakin Skywalker em Ataque dos Clones

Ação

Como a aplicação da política de rotas do SMART não é aplicável, vamos fazer do nosso jeito e usar o Cilium para proteger os endpoints enquanto Vader recebe a atenção imediata que o Imperador exige. Vamos agir como os Rebeldes aqui no cluster e transferir a proteção de endpoint/rota para o Cilium enquanto a Galáxia se recupera da interrupção.

Vamos implementar uma política de 'negar tudo' de qualquer lugar, usando uma CiliumClusterwideNetworkPolicy, e trabalhar de trás para frente no estilo de 'confiança zero'.

cat <<EOF | kubectl apply -n galactic-fhir -f- 
apiVersion: cilium.io/v2
kind: CiliumClusterwideNetworkPolicy
metadata:
  name: "denyall-coruscanthealth"
spec:
  description: "Block all the traffic (except DNS) by default"
  egress:
  - toEndpoints:
    - matchLabels:
        io.kubernetes.pod.namespace: kube-system
        k8s-app: kube-dns
    toPorts:
    - ports:
      - port: '53'
        protocol: UDP
      rules:
        dns:
        - matchPattern: '*'
  endpointSelector:
    matchExpressions:
    - key: io.kubernetes.pod.namespace
      operator: NotIn
      values:
      - kube-system
EOF

Está ótimo, Cilium lançando como se fosse quente!

Agora, vamos abrir o endpoint FHIR no pod do InterSystems, desativando o cliente oauth2.

set app = "/intersystems/fhir/r5"
Set strategy = ##class(HS.FHIRServer.API.InteractionsStrategy).GetStrategyForEndpoint(app)
// 7 = Mass Openness
Set configData.DebugMode = 7
Set configData = strategy.GetServiceConfigData()
Do strategy.SaveServiceConfigData(configData)

Por último, vamos criar uma CiliumNetworkPolicy para permitir que qualquer pessoa da organização:império acesse a rota para o registro de Darth Vader no namespace galactic-fhir.

apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: "l7-visibility"
spec:
  endpointSelector:
    matchLabels:
      org: empire
  egress:
  - toPorts:
    - ports:
      - port: "53"
        protocol: ANY
      rules:
        dns:
        - matchPattern: "*"
  - toEndpoints:
    - matchLabels:
        "k8s:io.kubernetes.pod.namespace": galactic-fhir
    toPorts:
    - ports:
      - port: "52773"
        protocol: TCP
      rules:
        http:
          - method: "GET"
            path: "/intersystems/fhir/r5/Patient/DarthVader"
          - method: "HEAD"
            path: "/intersystems/fhir/r5/Patient/DarthVader"
EOF

Parece que podemos voltar ao iRacing, acho que estamos bem.



...exceto

 [Nota do tradutor: tradução da imagem abaixo]

Palpatine: Desculpe te acordar, parece que temos outro problema.

Sween: Por que a liderança sempre diz isso para apoiar as pessoas e assume que todos apenas trabalham e dormem?

Palpatine: Desculpe, achei que o pessoal da geração X não ligasse para nada e só dormisse o tempo todo.

Sween: justo

Palpatine: Então, os droids médicos estão dizendo que o Vader precisa de pernas, mas o plano de saúde precisa aprovar, mas não consegue acessar o registro para pré autorizar o procedimento.

Sween: surreal

Palpatine: Eu sei, não é? Eu tenho o maior de todos os planos de grupo largos em toda a galáxia e ainda tenho que navegar o sistema de saúde galáctico assim.

Sim, parece que o pagador está sendo descartado...

Veredicto da política = REJEITADO



Vamos adicionar outra política, permitindo que a organização:pagador acesse a rota de Vader:

cat <<EOF | kubectl apply -n galactic-fhir -f- 
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: "l7-visibility-payer"
spec:
  endpointSelector:
    matchLabels:
      org: payer
  egress:
  - toPorts:
    - ports:
      - port: "53"
        protocol: ANY
      rules:
        dns:
        - matchPattern: "*"
  - toEndpoints:
    - matchLabels:
        "k8s:io.kubernetes.pod.namespace": galactic-fhir
    toPorts:
    - ports:
      - port: "52773"
        protocol: TCP
      rules:
        http:
          - method: "GET"
            path: "/intersystems/fhir/r5/Patient/DarthVader"
          - method: "HEAD"
            path: "/intersystems/fhir/r5/Patient/DarthVader"
EOF

Bem, isso não foi suficiente, e podemos ver por quê.


 [Nota do tradutor: tradução da imagem abaixo]

Sween: Quem é Anakin?

Palpatine: Ah, o Anakin agora é Darth Vader

Sween: Desde quando?

Palpatine: Era Anakin, então virou Vader

Sween: Quando o "então virou" será agora?

Então ligamos para o pagador e pedimos que eles acessassem o registro do paciente "correto", e Anakin Skywalker recebe suas pernas.

Hora de desabafar...

[Nota do tradutor: tradução da imagem abaixo]

Sween: Você sabe que eles têm um problema sério de identidade Galáctica naquele sistema de saúde.

Sween: Me parece que o EMR que registrou o Darth fez um POST com um conjunto de nomes.


Resultado

[Nota do tradutor: tradução da imagem abaixo]

Está funcionando! Está funcionando!!!

讨论 (0)1
登录或注册以继续
公告
· 十月 8, 2024

[Video] Using AI to Automate and Improve Resident Funding in Nursing Homes

Hey Community,

Watch this video to learn how InterSystems partner Mirus uses InterSystems IRIS to deliver clean data from multiple systems and feed a robust AI model that ensures that providers receive full funding for each resident while reducing administrative burden:

⏯ Using AI to Automate and Improve Resident Funding in Nursing Homes @ Global Summit 2024

Presenters:
🗣 Robert Covino, Founder and Partner, Mirus Australia
🗣 Alejandro Moran, Head of AI Development, Mirus Australia  

Subscribe to our YouTube channel InterSystems Developers to get notifications about new videos!

讨论 (0)1
登录或注册以继续
问题
· 十月 8, 2024

Docker build with merge results in error

Hello,

I'm trying to create a custom IRIS4Health docker container utilizing CPF Merge but getting an error below. The merge file has been copied to the container within the docker file. Anybody know what would cause this error?

ERROR: failed to solve: process "/bin/sh -c iris start IRIS && iris merge IRIS mergefile.cpf" did not complete successfully: exit code: 133

1 Comment
讨论 (1)2
登录或注册以继续
问题
· 十月 8, 2024

How to convert IRIS from 8-bit into Unicode ?

I have an IRIS installation that is using 8-bit charset encoding (set to deu8 / Latin 1). I would like to convert everything (database and system)  to Unicode

Charset encoding is something asked during installation, is it possible to change this on the fly ? The installer clearly say that Unicode systems cannot be converted. What about 8 bit ? 

Same for database : is there possible conversion ?

My current plan is the following :

- export all globals from 8-bit instance
- install a new Unicode instance
- import all globals into Unicode instance

Is there a simpler approach ?

5 Comments
讨论 (5)3
登录或注册以继续
文章
· 十月 8, 2024 阅读大约需 4 分钟

LLM Models and RAG Applications Step-by-Step - Part I - Introduction

You have probably heard a lot about LLMs (Large Language Models) and the associated development of RAG (Retrieval Augmented Generation) applications over the last year. Well, in this series of articles we will explain the fundamentals of each term used and see how to develop a simple RAG application.

What is an LLM?

LLM models are part of what we know as generative AI and their foundation is the vectorization of huge amounts of texts. Through this vectorization we will obtain a vector space (excuse the redundancy) in which related words or terms will be closer to each other than to less related words.

Although the simplest way to visualize it is a 3-dimensional graph like the one in the previous image, the number of dimensions can be as large as desired; the greater the dimensions, the greater the precision in the relationships between terms and words and the greater the resource consumption of the same.

These models are trained with massive data sets that allow them to have enough information to be able to generate texts related to the request made to them, but... how does the model know which terms are related to the question asked? Very simple, by the so-called "similarity" between vectors, this is nothing more than a mathematical calculation that allows us to elucidate the distance between two vectors. The most common calculations are:

Through this type of calculation, the LLM will be able to put together a coherent answer based on terms close to the question asked in relation to its context.

All this is very well, but these LLMs have a limitation when it comes to their application for specific uses, since the information with which they have been trained is usually quite "general." If we want an LLM model to adapt to the specific needs of our business, we will have two options:

Fine tuning

Fine tuning is a technique that allows the retraining of LLM models with data related to a specific topic (procedural language, medical terminology, etc.). Using this technique, we can have models that are better suited to our needs without having to train a model from scratch.

The main drawback of this technique is that we still need to provide the LLM with a huge amount of information for such retraining and sometimes this can fall "short" of the expectations of a particular business.

Retrieval Augmented Generation

RAG is a technique that allows the LLM to include the context necessary to answer a given question without having to train or retrain the model specifically with the relevant information.

How do we include the necessary context in our LLM? It's very simple: when sending the question to the model, we will explicitly tell it to take into account the relevant information that we attach to answer the query made, and to do so, we will use vector databases from which we can extract the context related to the question submitted.

What is the best option for my problem, Fine tuning or RAG?

Both options have their advantages and disadvantages. On the one hand, Fine tuning allows you to include all the information related to the problem you want to solve within the LLM model, without needing third-party technologies such as a vector database to store contexts. On the other hand, it ties you to the retrained model, and if it does not meet the model's expectations, migrating to a new one can be quite tedious.

On the other hand, RAG needs features such as vector searches to be able to know which is the most exact context for the question we are passing to our LLM. This context must be stored in a vector database on which we will later perform queries to extract said information. The main advantage (apart from explicitly telling the LLM to use the context we provide) is that we are not tied to the LLM model, being able to change it for another one that is more suited to our needs.

As we have presented at the beginning of the article, we will focus on the development of an application example in RAG (without great pretensions, just to demonstrate how you can start).

Architecture of a RAG project

Let's briefly look at what architecture would be necessary for a RAG project:

On the one hand we will have the following actors:

  • Users : who will interact with the LLM by sending queries.
  • Context : Provided in advance to be included in user queries.
  • Vectorization model : to vectorize the different documents associated with the context.
  • Vector database : in this case it will be IRIS and it will store the different vectorized parts of the context documents.
  • LLM : LLM model that will receive the queries, for this example we have chosen MISTRAL.
  • Python application : intended for querying the vector database for context extraction and its inclusion in the LLM query.

In order not to complicate the diagram too much, I have omitted the application in charge of capturing the documents from the context, their division and subsequent vectorization and insertion. In the associated application you can consult this step as well as the subsequent one related to the query for extraction, but do not worry, we will see it in more detail in the next articles.

Associated with this article you have the project that we will use as a reference to explain each step in detail. This project is containerized in Docker and you can find a Python application using Jupyter Notebook and an instance of IRIS. You will need an account in MISTRAL AI to include the API Key that allows you to launch queries.

In the next article we will see how to register our context in a vector database. Stay tuned!

1 Comment
讨论 (1)1
登录或注册以继续