<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Thu Feb 08 23:18:26 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>FOLIO Jira</title>
    <link>https://folio-org.atlassian.net</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>1001.0.0-SNAPSHOT</version>
        <build-number>100246</build-number>
        <build-date>07-02-2024</build-date>
    </build-info>

<item>
            <title>[FOLIO-2130] SPIKE: how to clean up unused container instances</title>
                <link>https://folio-org.atlassian.net/browse/FOLIO-2130</link>
                <project id="10290" key="FOLIO">FOLIO</project>
                    <description>&lt;p&gt;This is a follow up of 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;FOLIO-2055&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/FOLIO-2055&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;create an Ansible role for backend-module that deploys the container to K8s cluster&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            FOLIO-2055
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;The goal of the SPIKE is to provide a description for the actual task.&lt;/p&gt;</description>
                <environment></environment>
        <key id="81347">FOLIO-2130</key>
            <summary>SPIKE: how to clean up unused container instances</summary>
                <type id="10003" iconUrl="https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium">Task</type>
                                            <priority id="10001" iconUrl="https://dev.folio.org/assets/jira-priority/jira-p2.svg">P2</priority>
                        <status id="6" iconUrl="https://folio-org.atlassian.net/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10003">Done</resolution>
                                                        <assignee accountid="5f9abc1eb45b2e007453f423">John Malconian</assignee>
                                                                <reporter accountid="557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d">Jakub Skoczen</reporter>
                                    <labels>
                            <label>platform-backlog</label>
                    </labels>
                <created>Mon, 1 Jul 2019 13:46:58 +0000</created>
                <updated>Wed, 3 Jun 2020 16:39:57 +0000</updated>
                            <resolved>Fri, 26 Jul 2019 14:50:54 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                                                            <comment id="196128" author="5c706fbb47a54a6728e59df2" created="Mon, 1 Jul 2019 17:19:59 +0000"  >&lt;p&gt;AFAICT, there is no single Okapi API call to discover what modules are unused. You would have to follow a script something like this:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Get list of tenants&lt;/li&gt;
	&lt;li&gt;For each tenant, get list of modules enabled&lt;/li&gt;
	&lt;li&gt;Compare list of enabled modules against the &lt;tt&gt;/&amp;#95;/discovery/modules&lt;/tt&gt; API &amp;#8211; modules that are visible in discovery but are not enabled for any tenant would be the candidates for cleanup&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;You would need to do this for all Okapi clusters that are sharing the K8s cluster to get a master list.&lt;/p&gt;

&lt;p&gt;Cleanup would consist of undeploying the module from the K8s cluster and deleting it from the Okapi discovery service on all Okapi clusters.&lt;/p&gt;</comment>
                                                            <comment id="196129" author="557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d" created="Tue, 2 Jul 2019 09:01:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5c706fbb47a54a6728e59df2&quot; class=&quot;user-hover&quot; rel=&quot;5c706fbb47a54a6728e59df2&quot; data-account-id=&quot;5c706fbb47a54a6728e59df2&quot; accountid=&quot;5c706fbb47a54a6728e59df2&quot; rel=&quot;noreferrer&quot;&gt;Wayne Schneider&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5f8314dfbdef80006f6f572d&quot; class=&quot;user-hover&quot; rel=&quot;5f8314dfbdef80006f6f572d&quot; data-account-id=&quot;5f8314dfbdef80006f6f572d&quot; accountid=&quot;5f8314dfbdef80006f6f572d&quot; rel=&quot;noreferrer&quot;&gt;Adam Dickmeiss&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5f9abc1eb45b2e007453f423&quot; class=&quot;user-hover&quot; rel=&quot;5f9abc1eb45b2e007453f423&quot; data-account-id=&quot;5f9abc1eb45b2e007453f423&quot; accountid=&quot;5f9abc1eb45b2e007453f423&quot; rel=&quot;noreferrer&quot;&gt;John Malconian&lt;/a&gt; My concern is that scripting something on top of existing Okapi APIs is error prone. Consider this scenario:&lt;/p&gt;

&lt;p&gt;1. A new build of a backend module is done by the CI and deployed to the FOLIO cluster. The module is registered with Okapi&apos;s discovery service but not used in any tenant configuration because the no UI PR has been issued yet.&lt;/p&gt;

&lt;p&gt;2. The process clean up runs and cleans up the seemingly unused instance&lt;/p&gt;

&lt;p&gt;3. UI developer issues a PR that requires the particular snapshot build of the backend module but fails because it&apos;s been cleaned up&lt;/p&gt;

&lt;p&gt;I am not sure what&apos;s the best approach here.  Maybe the clean-up process should run when merging the UI module PR?&lt;/p&gt;</comment>
                                                            <comment id="196130" author="5c706fbb47a54a6728e59df2" created="Mon, 8 Jul 2019 13:51:30 +0000"  >&lt;p&gt;Maybe simply some logic that prevents the latest versions (latest release + latest snapshot) of a module from being cleaned up, regardless of whether they are used by a tenant?&lt;/p&gt;</comment>
                                                            <comment id="196131" author="5f9abc1eb45b2e007453f423" created="Thu, 25 Jul 2019 15:43:19 +0000"  >&lt;p&gt;So I&apos;m thinking of the following retention policies:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;snapshots built from master:  unused backend modules that are not the latest two versions released are removed.   A script can determine which are two most recent versions by getting a list of modules descriptors from Okapi.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;proper releases:   We keep the three released versions of backend modules regardless of whether they are in-use by a tenant.   These modules can be determined in essentially same way as the snapshots  - just set &apos;preRelease=false&apos; when querying Okapi.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;branch releases:   All backend branch artifacts will reside in dedicated K8 namespaces.  These namespaces will be destroyed along with all associated resources that reside in the namespace when PR is closed.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;A script will need to be written that determines which module containers are candidates for removal.   This script will be invoked via Jenkins at a regular interval - for now,  daily.     The script will need to be able to query Okapi to determine which modules are in-use,  the status of PRs on Github, as well as conduct K8 operations via the K8 API.  &lt;/p&gt;</comment>
                                                            <comment id="196132" author="5f9abc1eb45b2e007453f423" created="Fri, 26 Jul 2019 14:45:31 +0000"  >&lt;p&gt;Next steps:  Discuss with team.  Create issue for cleanup script. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="10721">UXPROD-1827</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="81258">FOLIO-2194</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="81268">FOLIO-2055</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummarycf">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10057" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Development Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10144"><![CDATA[Core: Platform]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10019" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|hzx6pj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10020" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1158">CP: sprint 68</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10044" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10024" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>[CHART] Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 1 Jul 2019 17:19:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10025" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>[CHART] Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>