-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes.txt
107 lines (78 loc) · 3.9 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
https://github.com/open-horizon/anax/tree/master/anax-in-container
cd go/src/github.com/open-horizon/anax
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
export arch=arm64
export USE_DOCKER_BUILDX=true
export opsys=Linux
export ANAX_IMAGE_VERSION=1.0.0
export DOCKER_IMAGE_VERSION=1.0.0 should be ANAX_IMAGE_VERSION
make anax-image
docker run -d -t --name amd64_anax --privileged -p 127.0.0.1:8081:8510 -v /var/run/docker.sock:/var/run/docker.sock -v /var/tmp/horizon:/var/tmp/horizon openhorizon/amd64_anax:1.0.0
export HORIZON_URL='http://localhost:8081'
Dockerfile.ubi.amd64
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.0
LABEL vendor="IBM"
LABEL summary="The agent in a general purpose container."
LABEL description="A container which holds the edge node agent, to be used in environments where there is no operating sys>
ARG DOCKER_VER=19.03.8
# yum is not installed, use microdnf instead
# shadow-utils contains groupadd and adduser commands
# install docker cli
# create required directories
RUN microdnf update -y --nodocs && microdnf clean all && microdnf install --nodocs -y shadow-utils sudo \
&& microdnf install --nodocs -y openssl ca-certificates \
&& microdnf install -y wget iptables vim-minimal procps tar \
&& wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \
&& chmod +x ./jq \
&& mv jq /usr/bin \
&& curl -4fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz \
&& tar xzvf docker-${DOCKER_VER}.tgz --strip 1 -C /usr/bin docker/docker \
&& rm docker-${DOCKER_VER}.tgz \
&& mkdir -p /licenses /usr/horizon/bin /usr/horizon/web /var/horizon \
&& mkdir -p /etc/horizon/agbot/policy.d /etc/horizon/policy.d /etc/horizon/trust
RUN microdnf install nodejs
RUN npm cache clean -f
RUN npm install -g n
RUN n stable
RUN npm install -g hzn-cli
# add license file
COPY LICENSE.txt /licenses
# copy the horizon configurations
COPY config/anax.json /etc/horizon/
COPY config/hzn.json /etc/horizon/
# copy anax and hzn binaries
ADD anax /usr/horizon/bin/
ADD hzn /usr/bin/
WORKDIR /root
COPY script/anax.service /root/
# You can add a 2nd arg to this on the docker run cmd or the CMD statement in another dockerfile, to configure a specific >
ENTRYPOINT ["/root/anax.service", "start"]
oh-mesh
oh deploy createDeployment --name frontend --image quay.io/skupper/hello-world-frontend
oh deploy exposeDeployment --name frontend --port 8080 --type LoadBalancer
oh deploy createDeployment --name backend --image quay.io/skupper/hello-world-backend
oh deploy exposeDeployment --name backend --port 8080
k3s kubectl -n ohmesh-frontend-k3s-ns logs skupper-router-544bf88bb4-xdxd8
k3s kubectl -n ohmesh-frontend-k3s-ns logs skupper-router-544bf88bb4-xdxd8 -c agent
kubectl -n ohmesh-frontend-k3s-ns exec -i agent-6ff5f98f9-95v8r -- hzn node list
k3s kubectl get events -n ohmesh-backend-k3s-ns
k3s kubectl exec -it ohmesh-backend-f5c846596-swmxc -n ohmesh-backend-k3s-ns -- /bin/sh
cat hello
wget http://0.0.0.0:8080/api/health
cat health
wget http://0.0.0.0:8080/api/data
wget http://0.0.0.0:8080/api/date
netstat -anp
install hzn cli
sudo -s -E curl -sSL https://github.com/open-horizon/anax/releases/latest/download/agent-install.sh | sudo bash -s -- -i anax: -k ./agent-install.cfg -c css:
sudo add-apt-repository universe
hzn exchange service list --org myorg
hzn policy list
hzn exchange service listpolicy hello-world-01_1.0_arm64
hzn exchange service removepolicy hello-world-01_1.0_arm64
hzn exchange deployment listpolicy
hzn exchange deployment listpolicy myorg/policy-hello-world-01_1.0
hzn deploycheck all -b myorg/policy-hello-world-01_1.0 -n myorg/edge-device-1
hzn deploycheck all -b myorg/policy-hello-world-01_1.0 -n myorg/edge-device-1 -v
hzn exchange node addpolicy --json-file /root/hzn-config/node.policy.json dragon-fly -v
hzn exchange node addpolicy --json-file /home/cscharfstein/node.policy.json edge-device-1 -v