Changes for page Volume Mapping (On-premise)
Last modified by Erik Bakker on 2024/08/26 12:37
From version 50.1
edited by Erik Bakker
on 2022/10/31 15:24
on 2022/10/31 15:24
Change comment:
There is no comment for this version
To version 37.2
edited by Erik Bakker
on 2022/10/31 08:29
on 2022/10/31 08:29
Change comment:
Update document after refactoring.
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - VolumeMapping(On-premise)1 +novice-file-based-connectivity-volume-mapping-on-premise - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,11 +1,6 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 +In most cases, the customer wants some kind of insurance policy to determine whether a file has entered or left eMagiz. One way of supplying such functionality for file-based data exchange is through the use of archiving functionality. With the help of this functionality can you easily write the file as received (or about to be sent) to a separate location. By ensuring that the data stays in that location for a certain amount of time and by giving the customer and yourself access you have a sort of audit trail that details the messages that have been exchanged. This archive could also be used to analyze problems in case things go wrong. In this microlearning, we will learn how you can set up that archiving and learn how to clean up the archiving to ensure that data is only kept for a limited period. 2 2 3 -{{warning}} 4 -Please note that this microlearning is for the new monitoring stack only. 5 -{{/warning}} 6 - 7 -When you need to read and write files from an on-premise disk, you need to know the path in which the data is stored and make sure that the docker container in your runtime(s) running has access to this path. There are several ways of dealing with this challenge. First, this microlearning will discuss the various alternatives and best approaches in these scenarios. 8 - 9 9 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 10 10 11 11 == 1. Prerequisites == ... ... @@ -14,108 +14,81 @@ 14 14 15 15 == 2. Key concepts == 16 16 17 -This microlearning centers around learning how to set up yourolumemappingcorrectlyso you can exchange file-based data on-premise.12 +This microlearning centers around learning how to archive correctly. 18 18 19 -By volume mapping, we mean:Creating a configurationthroughwhichthedockercontainercanreadandwritedataon aspecific path onn on-premise machine.14 +By archiving, we mean: Temporarily storing data for audit purposes and possible retry scenarios. 20 20 21 -There are several options for volume mapping for your on-premise machine. 22 -* Volume 23 -* Bind mount 24 -* Temporary file system 25 -* Named pipe 16 +* Archiving is used for audit purposes 17 +* Archiving is used for retry scenarios 18 +* Ensure that data is cleaned after a retention period to keep in control of the data 26 26 27 -== 3. Volume Mapping(On-premise)==20 +== 3. Archiving == 28 28 29 - Whenyouneedtoread andwrite filesfroman on-premise disk,youneedtoknowthe path in whichthe dataisstoredandmakesurethat the dockercontainerinyour runtime(s)running has access to thispath.There are severalwaysfdealingwiththischallenge.First,this microlearning willdiscussthevariousalternativesandbest approachesin these scenarios.22 +In most cases, the customer wants some kind of insurance policy to determine whether a file has entered or left eMagiz. One way of supplying such functionality for file-based data exchange is through the use of archiving functionality. With the help of this functionality can you easily write the file as received (or about to be sent) to a separate location. By ensuring that the data stays in that location for a certain amount of time and by giving the customer and yourself access you have a sort of audit trail that details the messages that have been exchanged. This archive could also be used to analyze problems in case things go wrong. In this microlearning, we will learn how you can set up that archiving and learn how to clean up the archiving to ensure that data is only kept for a limited period. 30 30 31 -There are several options for volume mapping for your on-premise machine. 32 -* Volume 33 -* Bind mount 34 -* Temporary file system 35 -* Named pipe 24 +=== 3.1 Archiving itself === 36 36 37 - Belowwewill explainthe differencesbetweenthevariousoptionsavailableforyourvolumemapping.Butbeforewedo,we firstexplain howtosetupthisconfiguration within eMagiz.Then,youmustnavigatetoDeploy->Architectureonthemodel level.In this overview,youcan accesstheVolumemappingperruntimedeployedon-premise.Todoso,you canright-click on theruntime toaccessthecontextmenu.26 +To make this work in eMagiz you need to navigate to the Create phase of eMagiz and open the entry flow in which you want to archive the files. Within the context of this flow, we need to add functionality that will ensure that each input file is archived and cleaned up when older than three days. To do so first enter "Start Editing" mode on flow level. The first decision we have to take is how we are going to name the files within the archiving. The best practice, in this case, is the original filename + the current time as a suffix. You can define this by dragging a format file name generator (support object) to the canvas. 38 38 39 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity- volume-mapping-on-premise--volume-option-context-menu.png]]28 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--file-name-generator.png]] 40 40 41 - Whenyouclickthisoption,youwillseethe followingpop-up. Inthispop-up,youcandefine the machine-levelandruntime-levelvolumes.More onthatlater. Thisisthestartingpointfor configuringyourvolumemapping.We will walkthrougheach availableoption andexplainhowtheywork and should be configured.30 +After we have done this please add a file outbound channel adapter to the flow including an input channel. Ensure that you use a property for the directory that references another directory compared to the input directory to prevent creating an infinite loop. 42 42 43 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-v olume-mapping-on-premise--volume-mapping-pop-up.png]]32 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--archiving-config-file-outbound-basic.png]] 44 44 45 - {{info}}Notethatyoushould be in"Start editing"mode to makeanychangesto the configurationofyourvolume mapping.{{/info}}34 +Now that we have configured the basics let us turn our attention to the advanced configuration. In the advanced tab of this component, we need to select the file name generator to ensure that the files are named correctly. In case you process each line separately you have to choose whether to save them as separate files in the archive or by appending them again. This can be achieved by selecting the correct Mode. In most cases, however, the default Mode of Replace will suffice. 46 46 47 - === 3.1 Volume===36 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--archiving-config-file-outbound-advanced.png]] 48 48 49 -The firstType availabletoyou isVolume.Withthisoption,youcreate oneormorefoldersonDockerrelevant tothatruntimetoreadandwrite**persistent**data.ToconfigurethisType, youneedtolinkthe runtimevolumetoamachinevolumeyoucancreatewithin thesamepop-up. This meansyoucanre-usea"Machinevolume"overmultipleruntimes(i.e.,containers).38 +The moment you are satisfied press Save. Now that we have configured this it becomes time to determine how we get the needed input to write to our archive. In the example we are using here we want to archive our input file so we need to ensure that the data we received is written to the archive as soon as possible. To do so place a wiretap on the first channel after retrieving the file. This will make sure that the message is archived before processed further. The result should be something as shown below. Note that this same piece of logic could be applied in other flows within the eMagiz platform in a similar manner. 50 50 51 - So, we first open the tab called "Machine volume." Then, by pressingthe"New"button, wecandefine a new "Machinevolume." In the pop-up that follows, weanspecifythe name of a machinevolume and tell whether the Volumealready exists onyourdocker installation or not.40 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--archiving-result.png]] 52 52 53 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--machine-volumes-configuration.png]]42 +=== 3.2 Clean up the Archive === 54 54 55 - Onceyouhave doneso,weress"Save"andswitchbacktothe"Runtimevolumes"tab.Then,wepushthe"New"buttontocreate anew"Runtime volume."In thefollowingpop-up,wefirstneed toselect theTypewe wanttouse.For thisexample,weusetheTypecalled"Volume."Basedonyourselection, the relevantinputfieldswillchange.44 +To ensure that the data is not kept indefinitely we need to clean up the archive. We do so to prevent problems with disk space but also to prevent data leaks of old data that could impact the privacy of others. Before we can set up the logic in eMagiz we need to talk to the customer to see what an acceptable term is within which the data is kept. In most cases, this is a week or two weeks. In this example, we have chosen three days. 56 56 57 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-volume.png]]46 +Now that we know the limit it is time to configure the components. We start with a composite file filter (support object). Within this filter, we at least define how old a file must be before it can be deleted (in milliseconds). If we turn three days into milliseconds we get 259200000. Furthermore, we at least define that we only want to delete regular files. 58 58 59 - The first thing we need to select is the "Machine volume." Once we havechosen our "Machine volume," we must set the Targetspecific for this runtime.This target defines the second partof thepath to which theruntime will gainaccess.Forexample, whenyoufill in "/target", wecan combinehis with the "Machinevolume"name to arriveat the correct directoryfrom which eMagiz needsto read data (orwrite data to). So in ourase, this would be"/file-directory/target."48 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--file-list-filter-for-archive-cleanup.png]] 60 60 61 - The last settingweneedto configureistodefinewhich rightswewillgrantour runtimeon theVolumewe arecreating. Thedefaultsettingisread/writerightsfortheruntime,whichissufficientinmost cases.Thesultof followingthesestepswillbe thefollowing.50 +Having done so we can add a file inbound channel adapter to the canvas including an output channel. Ensure that the property reference for the directory matches the one you have used before in the outbound channel adapter. Furthermore link the filter to the component and define the poller according to the best practice. 62 62 63 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity- volume-mapping-on-premise--runtime-volumes-configuration-type-volume-filled-in.png]]52 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--file-inbound-archive-cleanup.png]] 64 64 65 - {{warning}}Note thatwhenyou use the Volumeoption,theexternalsystemwithwhichyou exchange dataon-premiseviaafile-basedmethodneedsto be able towrite oreadthedatafromtheVolume (i.e.,directory) youhave configuredinDocker.Shouldthisbe aproblem,theBindmountalternativediscussedbelowshouldbeconsidered.{{/warning}}54 +One thing we should not forget within this configuration is to set the Max messages per poll on the Advanced tab of the poller-configuration to a sufficiently high number (i.e. 50). If you forget to do so and you only check once a day it will mean that only one message will be deleted that day. 66 66 67 - === 3.2 Bindmount===56 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--file-inbound-archive-cleanup-max-messages-per-poll.png]] 68 68 69 - Analternativeoption toreadand write**persistent**dataistousethe"Bindmount"option.Ingeneral,weadviseusingthe"Volume"option because theyhavebetterperformance,andbindmountsdepend onthehost machine'sdirectory structureandOS. However,onlysomeexternalsystemscan adaptto thisthateasily.Forexample,the "Bindmount"optioncaninterestyour use case.58 +Now eMagiz will check on a set time interval whether there are files that are older than three days that are ready for deletion. One last step to go. This last step will ensure that all files that fit the bill will be deleted from the archive. Simply add a standard service activator to the canvas and define the following SPeL expression within the component: payload.delete(). 70 70 71 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity- volume-mapping-on-premise--runtime-volumes-configuration-type-bind-mount.png]]60 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-archiving--archive-cleanup-deletion.png]] 72 72 73 -T o configurea "Bindmount," you need to define asourceand atargetdirectorylinkedto eachother.Thesourcedirectory represents thedirectoryon yourlocalsystem (that might alreadybeusedcurrently toexchange files). Thetargetdirectorydefines a directoryon your docker installation that the runtimecan access.62 +This will ensure that each file that is retrieved will indeed be deleted from the archive. 74 74 75 -{{warning}}Note that when the source directory does not exist, the runtimes cannot be deployed correctly.{{/warning}} 76 - 77 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-bind-mount-filled-in.png]] 78 - 79 -{{info}}Note that when you use this option, your directory reference in your flow should refer to the "target" directory configured here.{{/info}} 80 - 81 -=== 3.3 Temporary file system === 82 - 83 -The temporary file system option is for you if you do not want to work with **persistent** data but require **non-persistent** data. This way, you can increase the container's performance by avoiding writing into the container's writable layer. 84 - 85 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-temp-file-storage.png]] 86 - 87 -To configure this option, you need a target location. On top of that, you can define the maximum size of the temporary file system. 88 - 89 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-temp-file-storage-filled-in.png]] 90 - 91 -{{warning}}We strongly advise you to define this number so that you can limit the potential impact this solution can have on the stability of your machine.{{/warning}} 92 - 93 -=== 3.4 Named pipe === 94 - 95 -The named pipe option can be selected, but we yet have to see a valid use case within the context of eMagiz for using this option. Therefore we won't discuss this option further in this microlearning. 96 - 97 97 == 4. Assignment == 98 98 99 - NavigatetoDeploy->Architectureandlook attheVolume mappingoptions, read thehelp texts,andplayaroundwiththesettings (if it is notacustomerenvironment).100 -This assignment can be completed with the help of the (Academy) project you created/used in the previous assignment. 66 +Configure an entry in which you build the archiving and the clean up of the archiving. 67 +This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 101 101 102 102 == 5. Key takeaways == 103 103 104 -* File-based communication on-premise changes in the new runtime architecture 105 -* There are two ways to store **persistent** data 106 - ** Volume 107 - ** Bind mount 108 -* The Volume option is considered the best alternative because they have better performance, and bind mounts are dependent on the directory structure and OS of the host machine 109 -* When you want to deal with **non-persistent** data, the Temporary file storage option is the way to go. 71 +* Archiving is used for audit purposes 72 +* Archiving is used for retry scenarios 73 +* Ensure that data is cleaned after a retention period to keep in control of the data 74 +* Don't forget the max messages per poll 110 110 111 111 == 6. Suggested Additional Readings == 112 112 113 -If you are interested in this topic and want more information ,please read the help text provided by eMagiz.78 +If you are interested in this topic and want more information on it please read the help text provided by eMagiz and check out the following store content: 114 114 80 +* [[File Archiving>>doc:Main.eMagiz Store.Accelerators.File Archiving.WebHome||target="blank"]] 81 +* [[Delete Folder(s)>>doc:Main.eMagiz Store.Accelerators.Delete Folder(s).WebHome||target="blank"]] 82 + 115 115 == 7. Silent demonstration video == 116 116 117 -This video demonstrates how you could have handled the assignment and gives context to what you have just learned.85 +This video demonstrates how you could have handled the assignment and gives you some context on what you have just learned. 118 118 119 - TBA87 +{{video attachment="novice-file-based-connectivity-characterset.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 120 120 121 121 )))((({{toc/}}))){{/container}}{{/container}}