Changes for page Volume Mapping (On-premise)
Last modified by Erik Bakker on 2024/08/26 12:37
From version 20.1
edited by eMagiz
on 2022/05/22 21:30
on 2022/05/22 21:30
Change comment:
There is no comment for this version
To version 69.1
edited by Erik Bakker
on 2024/03/05 08:56
on 2024/03/05 08:56
Change comment:
There is no comment for this version
Summary
-
Page properties (5 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 4 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,0 +1,1 @@ 1 +Volume Mapping (On-premise) - Parent
-
... ... @@ -1,0 +1,1 @@ 1 +WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. marijn1 +XWiki.ebakker - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,97 +1,158 @@ 1 -{{html wiki="true"}} 2 -<div class="ez-academy"> 3 - <div class="ez-academy_body"> 1 +{{container}}{{container layoutStyle="columns"}}((( 2 +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 ensure that the docker container in your runtime(s) running has access to this path. There are several ways of dealing with this challenge. This microlearning will discuss the various alternatives and best approaches in these scenarios. 4 4 5 - <divclass="doc">4 +Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 6 6 6 +== 1. Prerequisites == 7 7 8 +* Basic knowledge of the eMagiz platform 8 8 9 -= Annotations =10 +== 2. Key concepts == 10 10 11 - In this microlearning,we will focus on using annotations to clarify your thought process. Intheannotation, you eitherdescribeabest practice everyone shouldfollow when they change that flow (i.e. within the asynchronous routing),describehow the (morecomplex) parts of theflowwork or describe(partsof) ofyourmessage definitions (i.e. CDM, API Gateway Datamodel,systemmessage,etc.). Thiswill helpyourselfandothers every timechangesare needed.12 +This microlearning centers around learning how to correctly set up your volume mapping so you can exchange file-based data on-premise. 12 12 13 - Shouldyou have anyquestions,please contact academy@emagiz.com.14 +By volume mapping, we mean creating a configuration through which the docker container can read and write data on a specific path on an on-premise machine. Note that the data can also be stored inside the docker container when (1) the other party writing or reading the data can access this path or (2) when the data is only relevant within the context of eMagiz. 14 14 15 -* Last update: May 9th, 2021 16 -* Required reading time: 5 minutes 16 +There are several options for volume mapping for your on-premise machine. 17 +* Volume 18 +* Bind mount 19 +* Temporary file system 20 +* Named pipe 17 17 18 -== 1.Prerequisites==22 +== 3. Volume Mapping (On-premise) == 19 19 20 - *Basicknowledge of the eMagizplatform24 +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 ensure that the docker container in your runtime(s) running has access to this path. There are several ways of dealing with this challenge. This microlearning will discuss the various alternatives and best approaches in these scenarios. 21 21 22 -== 2. Key concepts == 26 +There are several options for volume mapping for your on-premise machine. 27 +* Machine volume 28 +* Bind mount 29 +* Network volume 30 +* Temporary file system 31 +* Named pipe 23 23 24 -This microlearning centers around using annotations. 25 -With annotations, we mean: A piece of text to explain something to yourself and others 33 +Below, we will explain the differences between the various options available for your volume mapping. But before we do this, we explain how to set up this configuration within eMagiz. First, you must navigate to Deploy -> Architecture on the model level. This overview lets you access the Volume mapping per runtime deployed on-premise. And then, you can right-click on the runtime to access the context menu. 26 26 27 - Annotationscanbeusedfor:35 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--volume-option-context-menu.png]] 28 28 29 -* Describing a best practice everyone should follow 30 -* Describing (more complex) parts of the flow 31 -* Describe (parts of) your message definitions 37 +Right after you click this option, you will see the following pop-up. In this pop-up, you can define the machine-level, runtime-level, and network-level volumes (more on this volume levels later). This pop-up page is the starting point for configuring your volume mapping. We will walk through each available option and explain how they work and should be configured. 32 32 39 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--volume-mapping-pop-up.png]] 33 33 41 +{{info}}Note that you should be in "Start editing" mode to make any changes to the configuration of your volume mapping.{{/info}} 34 34 35 -== 3. Annotations==43 +=== 3.1 Volume === 36 36 37 - In thismicrolearning,wewillfocus onusingannotationsonthe flowlevelto clarifyourthoughtprocess.In theannotation, you eitherdescribea bestpracticeeveryoneshouldfollow whenthey changethatflow (i.e.within theasynchronousrouting)ordescribehowthe(morecomplex)partsof theflow work.Thiswill helpyourself andotherseverytime changesare neededwithin theflow.45 +The first Type available to you is volume. With this option, you create one or more folders on Docker relevant to that runtime to read and write **persistent** data. To configure this Type, you need to link the runtime volume to a machine volume (or network volume) you can create within the same pop-up. This means you can re-use a "Machine volume" or a "Network volume" over multiple runtimes (i.e., containers). We first need to define a machine (or network) volume to do so. Once we have done that, we can learn how to link the volume to the machine or network volume. 38 38 39 - Annotationscanbe usedfor:47 +==== 3.1.1 Define Machine Volume ==== 40 40 41 -* Describing a best practice everyone should follow 42 -* Describing (more complex) parts of the flow 43 -* Describe (parts of) your message definitions 49 +So, we first open the tab called "Machine volume." Then, by pressing the "New" button, we can define a new "Machine volume." In the following pop-up, we can specify the name of a machine volume and tell whether the volume already exists on your docker installation. 44 44 45 - To clarify the use cases let us take a look at how annotations can be added within the eMagiz platform.In our first example, we will takea look at asynchronous routing.In many eMagiz projects, a best practice is followed on how toadd something to the asynchronous routing(or changesomething within the asynchronous routing). Becausethe best practice contains multiplesteps it makessense touse the annotation functionalityofeMagiz todefine all these steps andregister themat theplace youneed them(i.e. the asynchronousrouting).Havingdone so will result in something like this:51 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--machine-volumes-configuration.png]] 46 46 47 - <p align="center">[[image:novice-devops-perspectives-annotations--annotation-best-practice-async-routing.png||]]</p>53 +Once you have done so, we press "Save" and switch back to the "Runtime volumes" tab. 48 48 49 - The secondexample isaboutusingannotationsontheflowleveltodescribepartsof theflow.Inthis example, we will usethe annotation todescribethatweuseafiltertodeterminewhichmessagesare pickedup fromalocaldirectoryand howwe filter.That way anywayopeningtheflowhastomerely readthe annotationtoget thecontext.Havingdone sowillresultin something likethis:55 +{{info}}When stating that the machine volume already exists, you can re-use the same machine volume across multiple runtimes (i.e., containers). This is especially useful when archiving data. You can create a central volume in which the data is stored, and through the linkage of the volume to the machine volume, you can subsequently structure your archiving folder. The paths will then look as follows, "/archive/runtimename"{{/info}} 50 50 51 - <p align="center">[[image:novice-devops-perspectives-annotations--describe-parts-of-flow.png||]]</p>57 +==== 3.1.2 Define Network Volume ==== 52 52 53 - Thethird example doesnottakeplaceon theflowlevelbut themessage definitionlevel. Therefore insteadofgoing to Create,wegotoDesign.InDesignwhenyounavigate totheCDM, APIGatewayData model, Event StreamingData model,messagedefinitions,etc.youhavetheoptionto addannotationstothecanvas.In thisexample, we wanttomake clearto allthatmakechangesthatacertainpartof ourCDMis usedbyalot ofintegrationswithin eMagizand thereforeeveryoneshouldbecarefulandthink twicebefore adjustinganythingrelatedto that part. Havingdoneso will result in something like this:59 +So, we first open the tab called "Network volume." Then, by pressing the "New" button, we can define a new "Network volume." In the following pop-up, we can specify the name of a machine volume and configure the relevant information for a network volume. In most cases, a CIFS is used, and the only pertinent options that need to be filled in are the host, path, username, and password. 54 54 55 - <p align="center">[[image:novice-devops-perspectives-annotations--describe-crucial-part-of-cdm.png||]]</p>61 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--network-volumes-configuration.png]] 56 56 57 - Now that wesaw some examples letusturn ourattentionto the how. How can I add an annotationand how can I link it. Adding theannotation issimple. Youdrag theannotation icon from theleft context menu onto the canvas. As aresult,anempty annotation will beshown onthecanvas. By double-clickingon ityoucantype whateveryouwant. Note that you need to bein "Start Editing"modetochange anything, includingannotations.63 +Once you have done so, we press "Save" and switch back to the "Runtime volumes" tab. 58 58 59 -<p align="center">[[image:novice-devops-perspectives-annotations--annotation-icon-context-menu.png||]]</p> 65 +{{warning}}When configuring a network volume, the following information is relevant to know: 66 +* When you create a network volume to a folder that contains sub-folders, all sub-folders are shared automatically and can be accessed from the flow level 67 +* When dealing with multiple hosts, you must create a specific entry per host, as this follows the guiding security principles of the underlying infrastructure.{{/warning}} 60 60 61 - Whenyou are satisfied with what you have written down you can press the Save button.After you have done so you can rescale the annotation to ensure that the complete text is visible.To linkthe annotation to a component (on flow level) or an entity (on message definition level) youhover over the annotation until yourmouseindicator changes to a + icon, execute a right-click and drag from the annotation to the component in question.69 +==== 3.1.3 Link Volume ==== 62 62 63 - Nowyouknowwhat annotationsaregoodfor andhowyou canaddthem withinthe eMagizplatform.71 +In the "Runtime volumes" tab, we push the "New" button to create a new "Runtime volume." In the following pop-up, we must select the Type we want to use. For this example, we use the Type called "Volume." 64 64 65 - =====Practice=====73 +{{info}} The relevant input fields will change based on your selection. {{/info}} 66 66 67 - == 4.Assignment==75 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-volume.png]] 68 68 69 -Add annotation on the flow level that describes how (a part of) a flow works. 70 -This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 77 +The first thing we need to select is the "Volume." Once we have chosen our "Volume," we must set the Target specific for this runtime. This target defines the second part of the path to which the runtime will gain access. For example, when you fill in "/target", we can combine this with the "Volume" name to arrive at the correct directory from which eMagiz needs to read data (or write data to). So, in our case, in which we link the volume to the machine volume we created earlier, this would be "/file-directory/target." 71 71 72 - ==5.Keytakeaways==79 +The last setting we need to configure is to define the rights we will grant our runtime on the volume we create. The default setting is read/write rights for the runtime, which is usually sufficient. The result of following these steps will be the following. 73 73 74 -* Annotations can be used for: 75 - * Describing a best practice everyone should follow 76 - * Describing (more complex) parts of the flow 77 - * Describe (parts of) your message definitions 78 -* You can add annotations by dragging and dropping the annotation icon on the canvas. 81 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-volume-filled-in.png]] 79 79 83 +{{warning}}Note the following when considering using the Volume option: 84 +* In the case of using the Volume option in combination with a Machine volume, the external system with which you exchange data on-premise via a file-based method needs to be able to write or read the data from the volume (i.e., directory) you have configured. Should this be a problem, the Bind mount alternative discussed below should be considered. 85 +* The Volume option and Machine volume combination can also be used for eMagiz-only information that needs to be persistable, such as archiving. 86 +* In the case of using the Volume option in combination with a Network volume, the path to read and write from becomes what you define in the target field. 87 +* In case of mapping a volume on a windows host machine to another one on a windows docker runtime, the following small adjustment is required when writing the source/target paths: 88 +** All “\” in the source/target path should be written as “/”. For example: C:\Users\xxxx\tmp should be written as C:/Users/xxxx/tmp. 80 80 90 +{{/warning}} 81 81 82 -== 6.SuggestedAdditionalReadings==92 +=== 3.2 Bind mount === 83 83 84 - Thereare nosuggested additionalreadings on this topic94 +An alternative option to read and write **persistent** data is the "Bind mount" option. We generally advise using the "Volume" option because they perform better, and bind mounts depend on the host machine's directory structure and OS. However, only some external systems can adapt to this that easily. For example, the "Bind mount" option can interest your use case. 85 85 86 - == 7.Silentdemonstrationvideo==96 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-bind-mount.png]] 87 87 88 -T hisvideo demonstrates howyoucouldhavehandledtheassignment andgives yousomecontextonwhatyouhavejustlearned.98 +To configure a "Bind mount," you need to define a source and a target directory linked to each other. The source directory represents the directory on your local system (that might already be used currently to exchange files). The target directory defines a directory on your docker installation that the runtime can access. 89 89 90 - <iframewidth="1280" height="720"src="../../vid/microlearning/novice-devops-perspectives-annotations.mp4" frameborder="0" allow="accelerometer;autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>100 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-bind-mount-filled-in.png]] 91 91 92 - </div>102 +{{info}}Note that when you use this option, your directory reference in your flow should refer to the "target" directory configured here.{{/info}} 93 93 94 -</div> 95 -</div> 104 +{{warning}} 105 +When configuring a bind mount on a windows host machine to another one on a windows docker runtime, the following small adjustment is required when writing the source/target paths: 106 +** All “\” in the source/target path should be written as “/”. For example: C:\Users\xxxx\tmp should be written as C:/Users/xxxx/tmp. 107 +{{/warning}} 96 96 97 -{{/html}} 109 +=== 3.3 Temporary file system === 110 + 111 +{{info}}This option is only relevant when running on **Linux**.{{/info}} 112 + 113 +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. 114 + 115 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-temp-file-storage.png]] 116 + 117 +To configure this option, you need a target location. On top of that, you can define the maximum size of the temporary file system. 118 + 119 +[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-volume-mapping-on-premise--runtime-volumes-configuration-type-temp-file-storage-filled-in.png]] 120 + 121 +{{warning}} 122 +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}} 123 + 124 +=== 3.4 Named pipe === 125 + 126 +{{info}}This option is only relevant when running on **Windows**.{{/info}} 127 + 128 +A named pipe is a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. All instances of a named pipe share the same pipe name, but each instance has its own buffers and handles, and provides a separate conduit for client/server communication. Any process can access named pipes, subject to security checks, making named pipes an easy form of communication between related or unrelated processes. 129 + 130 +*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. 131 + 132 +{{warning}} 133 +* When configuring a pipe path on a windows host machine to another one on a windows docker runtime, the following small adjustment is required when writing the source/target paths: 134 +** All “\” in the source/target path should be written as “/”. For example: C:\Users\xxxx\tmp should be written as C:/Users/xxxx/tmp.{{/warning}} 135 + 136 +=== 3.5 Deployment consequences === 137 + 138 +{{warning}} 139 +* Note that the runtimes cannot be deployed correctly when the source directory **does not exist**. Consequently, no runtime on that machine will start up. One of the following two configurations displayed below are needed to find the source directory: 140 +** /mnt/host/{local-directory} 141 +** /run/desktop/mnt/host/{local-directory} 142 +* When the source directory can be found but the user has no access, the deployment will **fail** for the specific runtime in question with the volume mapping configured. All other runtimes (i.e., containers) will start up (pending other configuration issues).{{/warning}} 143 + 144 +== 4. Key takeaways == 145 + 146 +* File-based communication on-premise changes in the new runtime architecture 147 +* There are two ways to store **persistent** data 148 + ** Volume 149 + ** Bind mount 150 +* 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 151 +* Before deploying, ensure that the various sources in your configuration exist and that access is granted to avoid problems while deploying. 152 +* The Temporary file storage option is the way to go when dealing with **non-persistent** data. 153 + 154 +== 5. Suggested Additional Readings == 155 + 156 +If you are interested in this topic and want more information, please read the help text provided by eMagiz. 157 + 158 +)))((({{toc/}}))){{/container}}{{/container}}
- novice-devops-perspectives-annotations--annotation-best-practice-async-routing.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.marijn - Size
-
... ... @@ -1,1 +1,0 @@ 1 -25.7 KB - Content
- novice-devops-perspectives-annotations--annotation-icon-context-menu.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.marijn - Size
-
... ... @@ -1,1 +1,0 @@ 1 -774 bytes - Content
- novice-devops-perspectives-annotations--describe-crucial-part-of-cdm.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.marijn - Size
-
... ... @@ -1,1 +1,0 @@ 1 -15.5 KB - Content
- novice-devops-perspectives-annotations--describe-parts-of-flow.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.marijn - Size
-
... ... @@ -1,1 +1,0 @@ 1 -18.9 KB - Content