File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
go/core/internal/controller/translator/agent Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,20 @@ _dest="$(cat <<'ENDVAL'
5555ENDVAL
5656)"
5757echo " Exporting OCI image ${_image} into ${_dest}"
58- krane export{{ if $ .InsecureOCI }} --insecure{{ end }} " $_image" '/tmp/oci-skill.tar '
58+ _uname= " $(uname -m)"
59+ case " $_uname" in
60+ x86_64| amd64)
61+ _arch= " amd64"
62+ ;;
63+ aarch64| arm64)
64+ _arch= " arm64"
65+ ;;
66+ *)
67+ echo " Unsupported architecture for OCI export: ${_uname}" >&2
68+ exit 1
69+ ;;
70+ esac
71+ krane export{{ if $ .InsecureOCI }} --insecure{{ end }} --platform " linux/${_arch}" " $_image" '/tmp/oci-skill.tar '
5972mkdir -p " $_dest"
6073tar xf '/tmp/oci-skill.tar ' -C " $_dest"
6174rm -f '/tmp/oci-skill.tar '
Original file line number Diff line number Diff line change 235235 "command" : [
236236 " /bin/sh" ,
237237 " -c" ,
238- "set -e\n_auth_mount=\"$(cat \u003c\u003c'ENDVAL'\n/git-auth\nENDVAL\n)\"\nif [ -f \"${_auth_mount}/ssh-privatekey\" ]; then\n mkdir -p ~/.ssh\n cp \"${_auth_mount}/ssh-privatekey\" ~/.ssh/id_rsa\n chmod 600 ~/.ssh/id_rsa\n ssh-keyscan github.com gitlab.com bitbucket.org \u003e\u003e ~/.ssh/known_hosts\nelif [ -f \"${_auth_mount}/token\" ]; then\n git config --global credential.helper \"!f() { echo username=x-access-token; echo password=\\$(cat ${_auth_mount}/token); }; f\"\nfi\n_url=\"$(cat \u003c\u003c'ENDVAL'\nhttps://github.com/org/my-skills\nENDVAL\n)\"\n_ref=\"$(cat \u003c\u003c'ENDVAL'\nv2.0.0\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/k8s-skill\nENDVAL\n)\"\necho \"Cloning ${_url} (ref ${_ref}) into ${_dest}\"\ngit clone --depth 1 --branch \"$_ref\" -- \"$_url\" \"$_dest\"\n_subpath=\"$(cat \u003c\u003c'ENDVAL'\nskills/k8s\nENDVAL\n)\"\n_tmp=\"$(mktemp -d)\"\ncp -a \"${_dest}/${_subpath}/.\" \"$_tmp/\"\nrm -rf \"$_dest\"\nmv \"$_tmp\" \"$_dest\"\n_url=\"$(cat \u003c\u003c'ENDVAL'\nhttps://github.com/org/another-skill\nENDVAL\n)\"\n_ref=\"$(cat \u003c\u003c'ENDVAL'\nabc123def456abc123def456abc123def456abc1\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/another-skill\nENDVAL\n)\"\necho \"Cloning ${_url} (commit ${_ref}) into ${_dest}\"\ngit clone -- \"$_url\" \"$_dest\"\ncd \"$_dest\" \u0026\u0026 git checkout \"$_ref\"\n_url=\"$(cat \u003c\u003c'ENDVAL'\nhttps://github.com/org/private-skill\nENDVAL\n)\"\n_ref=\"$(cat \u003c\u003c'ENDVAL'\nmain\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/private-skill\nENDVAL\n)\"\necho \"Cloning ${_url} (ref ${_ref}) into ${_dest}\"\ngit clone --depth 1 --branch \"$_ref\" -- \"$_url\" \"$_dest\"\n_image=\"$(cat \u003c\u003c'ENDVAL'\nghcr.io/org/oci-skill:v1.0\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/oci-skill\nENDVAL\n)\"\necho \"Exporting OCI image ${_image} into ${_dest}\"\nkrane export \"$_image\" '/tmp/oci-skill.tar'\nmkdir -p \"$_dest\"\ntar xf '/tmp/oci-skill.tar' -C \"$_dest\"\nrm -f '/tmp/oci-skill.tar'\n"
238+ "set -e\n_auth_mount=\"$(cat \u003c\u003c'ENDVAL'\n/git-auth\nENDVAL\n)\"\nif [ -f \"${_auth_mount}/ssh-privatekey\" ]; then\n mkdir -p ~/.ssh\n cp \"${_auth_mount}/ssh-privatekey\" ~/.ssh/id_rsa\n chmod 600 ~/.ssh/id_rsa\n ssh-keyscan github.com gitlab.com bitbucket.org \u003e\u003e ~/.ssh/known_hosts\nelif [ -f \"${_auth_mount}/token\" ]; then\n git config --global credential.helper \"!f() { echo username=x-access-token; echo password=\\$(cat ${_auth_mount}/token); }; f\"\nfi\n_url=\"$(cat \u003c\u003c'ENDVAL'\nhttps://github.com/org/my-skills\nENDVAL\n)\"\n_ref=\"$(cat \u003c\u003c'ENDVAL'\nv2.0.0\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/k8s-skill\nENDVAL\n)\"\necho \"Cloning ${_url} (ref ${_ref}) into ${_dest}\"\ngit clone --depth 1 --branch \"$_ref\" -- \"$_url\" \"$_dest\"\n_subpath=\"$(cat \u003c\u003c'ENDVAL'\nskills/k8s\nENDVAL\n)\"\n_tmp=\"$(mktemp -d)\"\ncp -a \"${_dest}/${_subpath}/.\" \"$_tmp/\"\nrm -rf \"$_dest\"\nmv \"$_tmp\" \"$_dest\"\n_url=\"$(cat \u003c\u003c'ENDVAL'\nhttps://github.com/org/another-skill\nENDVAL\n)\"\n_ref=\"$(cat \u003c\u003c'ENDVAL'\nabc123def456abc123def456abc123def456abc1\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/another-skill\nENDVAL\n)\"\necho \"Cloning ${_url} (commit ${_ref}) into ${_dest}\"\ngit clone -- \"$_url\" \"$_dest\"\ncd \"$_dest\" \u0026\u0026 git checkout \"$_ref\"\n_url=\"$(cat \u003c\u003c'ENDVAL'\nhttps://github.com/org/private-skill\nENDVAL\n)\"\n_ref=\"$(cat \u003c\u003c'ENDVAL'\nmain\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/private-skill\nENDVAL\n)\"\necho \"Cloning ${_url} (ref ${_ref}) into ${_dest}\"\ngit clone --depth 1 --branch \"$_ref\" -- \"$_url\" \"$_dest\"\n_image=\"$(cat \u003c\u003c'ENDVAL'\nghcr.io/org/oci-skill:v1.0\nENDVAL\n)\"\n_dest=\"$(cat \u003c\u003c'ENDVAL'\n/skills/oci-skill\nENDVAL\n)\"\necho \"Exporting OCI image ${_image} into ${_dest}\"\n_uname=\"$(uname -m)\"\ncase \"$_uname\" in\n x86_64|amd64)\n _arch=\"amd64\"\n ;;\n aarch64|arm64)\n _arch=\"arm64\"\n ;;\n *)\n echo \"Unsupported architecture for OCI export: ${_uname}\" \u003e\u00262\n exit 1\n ;;\nesac\nkrane export --platform \"linux/${_arch}\" \"$_image\" '/tmp/oci-skill.tar'\nmkdir -p \"$_dest\"\ntar xf '/tmp/oci-skill.tar' -C \"$_dest\"\nrm -f '/tmp/oci-skill.tar'\n"
239239 ],
240240 "image" : " cr.kagent.dev/kagent-dev/kagent/skills-init:dev" ,
241241 "name" : " skills-init" ,
Original file line number Diff line number Diff line change 235235 "command" : [
236236 " /bin/sh" ,
237237 " -c" ,
238- " set -e\n _image=\" $(cat \u003c\u003c 'ENDVAL'\n foo:latest\n ENDVAL\n )\"\n _dest=\" $(cat \u003c\u003c 'ENDVAL'\n /skills/foo\n ENDVAL\n )\"\n echo \" Exporting OCI image ${_image} into ${_dest}\"\n krane export \" $_image\" '/tmp/oci-skill.tar'\n mkdir -p \" $_dest\"\n tar xf '/tmp/oci-skill.tar' -C \" $_dest\"\n rm -f '/tmp/oci-skill.tar'\n "
238+ " set -e\n _image=\" $(cat \u003c\u003c 'ENDVAL'\n foo:latest\n ENDVAL\n )\"\n _dest=\" $(cat \u003c\u003c 'ENDVAL'\n /skills/foo\n ENDVAL\n )\"\n echo \" Exporting OCI image ${_image} into ${_dest}\"\n _uname= \" $(uname -m) \"\n case \" $_uname \" in \n x86_64|amd64) \n _arch= \" amd64 \"\n ;; \n aarch64|arm64) \n _arch= \" arm64 \"\n ;; \n *) \n echo \" Unsupported architecture for OCI export: ${_uname} \" \u003e\u0026 2 \n exit 1 \n ;; \n esac \ n krane export --platform \" linux/${_arch} \" \" $_image\" '/tmp/oci-skill.tar'\n mkdir -p \" $_dest\"\n tar xf '/tmp/oci-skill.tar' -C \" $_dest\"\n rm -f '/tmp/oci-skill.tar'\n "
239239 ],
240240 "image" : " cr.kagent.dev/kagent-dev/kagent/skills-init:dev" ,
241241 "name" : " skills-init" ,
You can’t perform that action at this time.
0 commit comments