Files
Akilan-website/public/technicalposts/p2prc-plugin-module-implementation/index.html
2025-04-05 11:20:00 +01:00

55 lines
16 KiB
HTML

<!doctype html><html lang=en dir=auto><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>P2PRC Plugin module implementation | Akilan</title>
<meta name=keywords content="P2PRC,Plugin"><meta name=description content="Plugin Module implementation P2PRC"><meta name=author content="Akilan Selvacoumar"><link rel=canonical href=http://localhost:1313/technicalposts/p2prc-plugin-module-implementation/><link crossorigin=anonymous href=/assets/css/stylesheet.f49d66caae9ea0fd43f21f29e71a8d3e284517ed770f2aa86fa012953ad3c9ef.css integrity="sha256-9J1myq6eoP1D8h8p5xqNPihFF+13Dyqob6ASlTrTye8=" rel="preload stylesheet" as=style><link rel=icon href=http://localhost:1313/favicon.ico><link rel=icon type=image/png sizes=16x16 href=http://localhost:1313/favicon-16x16.png><link rel=icon type=image/png sizes=32x32 href=http://localhost:1313/favicon-32x32.png><link rel=apple-touch-icon href=http://localhost:1313/apple-touch-icon.png><link rel=mask-icon href=http://localhost:1313/safari-pinned-tab.svg><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate hreflang=en href=http://localhost:1313/technicalposts/p2prc-plugin-module-implementation/><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--code-block-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><meta property="og:url" content="http://localhost:1313/technicalposts/p2prc-plugin-module-implementation/"><meta property="og:site_name" content="Akilan"><meta property="og:title" content="P2PRC Plugin module implementation"><meta property="og:description" content="Plugin Module implementation P2PRC"><meta property="og:locale" content="en"><meta property="og:type" content="article"><meta property="article:section" content="technicalposts"><meta property="article:published_time" content="2021-07-16T00:00:00+00:00"><meta property="article:modified_time" content="2021-07-16T00:00:00+00:00"><meta property="article:tag" content="P2PRC"><meta property="article:tag" content="Plugin"><meta name=twitter:card content="summary"><meta name=twitter:title content="P2PRC Plugin module implementation"><meta name=twitter:description content="Plugin Module implementation P2PRC"><script type=application/ld+json>{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Technical Posts","item":"http://localhost:1313/technicalposts/"},{"@type":"ListItem","position":2,"name":"P2PRC Plugin module implementation","item":"http://localhost:1313/technicalposts/p2prc-plugin-module-implementation/"}]}</script><script type=application/ld+json>{"@context":"https://schema.org","@type":"BlogPosting","headline":"P2PRC Plugin module implementation","name":"P2PRC Plugin module implementation","description":"Plugin Module implementation P2PRC","keywords":["P2PRC","Plugin"],"articleBody":"Introduction The plugin module is designed to ensure clients can execute instructions in a declarative manner across different containers created. This means the user (i.e client) needs to write the instruction only once, and these instructions can be executed across different nodes in a repetitive manner.\nIn the scenario of this project Ansibles will be used as the way the users can create these instructions.\nThe plugin module introduces a new path to the config file known as pluginpath. This path by defaults points to ${P2PRC}/plugin/deploy. Any file/folder inside plugin/deploy is part of the .gitginore. Plugins are detected by folder names inside the plugin/deploy.\nplugin |___ Deploy |___ |___ site.yml |___ hosts |___ description.txt . . . n: n number of plugins possible Site File Template The site file is also known as the Ansible playbook and is incharge of executing instructions in a declarative manner. The below example specifies how to make one.\n- hosts: all tasks: - name: debug: msg: Read more about ansible tasks: https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#about-playbooks\nHosts file hosts file is also known as the inventory file. This file consists of all the information required to connect to other nodes to execute Ansible instructions. In this project this file needs to be set in a certain configuration because the go code or binary will populate this file automatically with the appropriate information required to connect to local or remote containers.\nNote: Add as exactly specified below all: vars: ansible_python_interpreter: /usr/bin/python3 // Path to your python 3 interpreter main: hosts: host1: // Note: These values will be automatically overwritten // by the Go functions ansible_host: 0.0.0.0 ansible_port: 39269 ansible_user: master ansible_ssh_pass: password ansible_sudo_pass: password Description file This is a simple text file used to describe what the module does. When the client is looking at various commands via the ClI. The description is displayed along-side the plugin name.\nEx: When the flag --ViewPlugins or --vp is called\n{ \"PluginsDetected\": [ { \"FolderName\": \"\", \"PluginDescription\": \"\" } ] } Based on PR: https://github.com/Akilan1999/p2p-rendering-computation/pull/50 ","wordCount":"346","inLanguage":"en","datePublished":"2021-07-16T00:00:00Z","dateModified":"2021-07-16T00:00:00Z","author":{"@type":"Person","name":"Akilan Selvacoumar"},"mainEntityOfPage":{"@type":"WebPage","@id":"http://localhost:1313/technicalposts/p2prc-plugin-module-implementation/"},"publisher":{"@type":"Organization","name":"Akilan","logo":{"@type":"ImageObject","url":"http://localhost:1313/favicon.ico"}}}</script></head><body id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=http://localhost:1313/ accesskey=h title="Akilan (Alt + H)">Akilan</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)" aria-label="Toggle theme"><svg id="moon" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=http://localhost:1313/about/ title=About><span>About</span></a></li><li><a href=http://localhost:1313/resume/ title=Resumé><span>Resumé</span></a></li><li><a href=http://localhost:1313/projects/ title=Projects><span>Projects</span></a></li><li><a href=http://localhost:1313/technicalposts/ title="Technical Posts"><span>Technical Posts</span></a></li><li><a href=http://localhost:1313/generalposts/ title="General Posts"><span>General Posts</span></a></li><li><a href=http://localhost:1313/papers/ title=Papers><span>Papers</span></a></li><li><a href=http://localhost:1313/chat/ title=Chat><span>Chat</span></a></li><li><a href=http://localhost:1313/hiking/ title=Hiking><span>Hiking</span></a></li></ul></nav></header><main class=main><article class=post-single><header class=post-header><div class=breadcrumbs><a href=http://localhost:1313/>Home</a>&nbsp;»&nbsp;<a href=http://localhost:1313/technicalposts/>Technical Posts</a></div><h1 class="post-title entry-hint-parent">P2PRC Plugin module implementation</h1><div class=post-meta><span title='2021-07-16 00:00:00 +0000 UTC'>2021-16-07</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;Akilan Selvacoumar&nbsp;|&nbsp;<a href=https://github.com/Akilan1999/Akilan-website/tree/master/content/technicalposts/P2PRC-Plugin-Module-Implementation.md rel="noopener noreferrer" target=_blank>Suggest Changes</a></div></header><div class=toc><details><summary accesskey=c title="(Alt + C)"><span class=details>Table of Contents</span></summary><div class=inner><ul><li><a href=#introduction aria-label=Introduction>Introduction</a></li><li><a href=#site-file-template aria-label="Site File Template">Site File Template</a></li><li><a href=#hosts-file aria-label="Hosts file">Hosts file</a><ul><ul><li><a href=#note-add-as-exactly-specified-below aria-label="Note: Add as exactly specified below">Note: Add as exactly specified below</a></li></ul></ul></li><li><a href=#description-file aria-label="Description file">Description file</a><ul><ul><li><a href=#based-on-pr aria-label="Based on PR: https://github.com/Akilan1999/p2p-rendering-computation/pull/50">Based on PR: https://github.com/Akilan1999/p2p-rendering-computation/pull/50</a></li></ul></ul></li></ul></div></details></div><div class=post-content><h2 id=introduction>Introduction<a hidden class=anchor aria-hidden=true href=#introduction>#</a></h2><p>The plugin module is designed to ensure clients can execute instructions in a declarative manner across different
containers created. This means the user (i.e client) needs to write the instruction only once, and these instructions
can be executed across different nodes in a repetitive manner.</p><p>In the scenario of this project Ansibles will be used as the way the users can create these instructions.</p><p>The plugin module introduces a new path to the config file known as pluginpath. This path by defaults points to
<code>${P2PRC}/plugin/deploy</code>. Any file/folder inside <code>plugin/deploy</code> is part of the .gitginore. Plugins are
detected by folder names inside the <code>plugin/deploy</code>.</p><pre tabindex=0><code>plugin
|___ Deploy
|___&lt;plugin name&gt;
|___ site.yml
|___ hosts
|___ description.txt
.
.
.
n: n number of plugins possible
</code></pre><h2 id=site-file-template>Site File Template<a hidden class=anchor aria-hidden=true href=#site-file-template>#</a></h2><p>The site file is also known as the Ansible playbook and is incharge of executing
instructions in a declarative manner. The below example specifies how to make one.</p><pre tabindex=0><code>- hosts: all
tasks:
- name: &lt;task name&gt;
&lt;ansible task&gt;
debug:
msg: &lt;debug message&gt;
</code></pre><p>Read more about ansible tasks: <a href=https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#about-playbooks>https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#about-playbooks</a></p><h2 id=hosts-file>Hosts file<a hidden class=anchor aria-hidden=true href=#hosts-file>#</a></h2><p>hosts file is also known as the inventory file. This file consists of all the information required to connect to other
nodes to execute Ansible instructions. In this project this file needs to be set in a certain configuration because the
go code or binary will populate this file automatically with the appropriate information required to connect to local or
remote containers.</p><h4 id=note-add-as-exactly-specified-below>Note: Add as exactly specified below<a hidden class=anchor aria-hidden=true href=#note-add-as-exactly-specified-below>#</a></h4><pre tabindex=0><code>all:
vars:
ansible_python_interpreter: /usr/bin/python3 // Path to your python 3 interpreter
main:
hosts:
host1:
// Note: These values will be automatically overwritten
// by the Go functions
ansible_host: 0.0.0.0
ansible_port: 39269
ansible_user: master
ansible_ssh_pass: password
ansible_sudo_pass: password
</code></pre><h2 id=description-file>Description file<a hidden class=anchor aria-hidden=true href=#description-file>#</a></h2><p>This is a simple text file used to describe what the module does.
When the client is looking at various commands via the ClI.
The description is displayed along-side the plugin name.</p><p>Ex: When the flag <code>--ViewPlugins</code> or <code>--vp</code> is called</p><pre tabindex=0><code>{
&#34;PluginsDetected&#34;: [
{
&#34;FolderName&#34;: &#34;&lt;name of the plugin&gt;&#34;,
&#34;PluginDescription&#34;: &#34;&lt;description of the plugin&gt;&#34;
}
]
}
</code></pre><h4 id=based-on-pr>Based on PR: <a href=https://github.com/Akilan1999/p2p-rendering-computation/pull/50>https://github.com/Akilan1999/p2p-rendering-computation/pull/50</a><a hidden class=anchor aria-hidden=true href=#based-on-pr>#</a></h4></div><footer class=post-footer><ul class=post-tags><li><a href=http://localhost:1313/tags/p2prc/>P2PRC</a></li><li><a href=http://localhost:1313/tags/plugin/>Plugin</a></li></ul><nav class=paginav><a class=prev href=http://localhost:1313/technicalposts/p2prc-ast/><span class=title>« Prev</span><br><span>Extension of P2PRC to create your own modification</span>
</a><a class=next href=http://localhost:1313/technicalposts/modifying-laplace-keyboard-mouse/><span class=title>Next »</span><br><span>Patch: Using remote ScreenShare ,keyboard and mouse using laplace and Barrier</span></a></nav></footer></article></main><footer class=footer><span>&copy; 2025 <a href=http://localhost:1313/>Akilan</a></span> ·
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
<a href=https://github.com/adityatelange/hugo-PaperMod/ rel=noopener target=_blank>PaperMod</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg>
</a><script>let menu=document.getElementById("menu");menu&&(menu.scrollLeft=localStorage.getItem("menu-scroll-position"),menu.onscroll=function(){localStorage.setItem("menu-scroll-position",menu.scrollLeft)}),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){e.preventDefault();var t=this.getAttribute("href").substr(1);window.matchMedia("(prefers-reduced-motion: reduce)").matches?document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView():document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView({behavior:"smooth"}),t==="top"?history.replaceState(null,null," "):history.pushState(null,null,`#${t}`)})})</script><script>var mybutton=document.getElementById("top-link");window.onscroll=function(){document.body.scrollTop>800||document.documentElement.scrollTop>800?(mybutton.style.visibility="visible",mybutton.style.opacity="1"):(mybutton.style.visibility="hidden",mybutton.style.opacity="0")}</script><script>document.getElementById("theme-toggle").addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove("dark"),localStorage.setItem("pref-theme","light")):(document.body.classList.add("dark"),localStorage.setItem("pref-theme","dark"))})</script></body></html>