{"id":15081,"date":"2023-08-08T16:05:44","date_gmt":"2023-08-08T14:05:44","guid":{"rendered":"https:\/\/ucit.fr\/?p=15041"},"modified":"2023-09-07T16:12:42","modified_gmt":"2023-09-07T14:12:42","slug":"integrating-the-oka-suite-with-your-aws-cluster","status":"publish","type":"post","link":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/","title":{"rendered":"Integrating the OKA Suite with your AWS cluster"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-1\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-blend:overlay;--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><p><\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-2\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-1 fusion-sep-none fusion-title-text fusion-title-size-one\"><h1 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:64.6;line-height:1.4;\">Integrating the OKA Suite with your AWS cluster<\/h1><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-3 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-3\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-margin-top:60px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-2\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">Efficiently running an HPC infrastructure is complex, and often lacks the proper tools to track down and get insights on how the users are behaving and how the cluster is responding to the demand. This is even more complicated when using Cloud clusters. Due to their transient and dynamic nature, information about instances types, location and costs are important assets to monitor, especially when you pay for what you use. The task of managing and presenting these metrics becomes increasingly difficult when the scale of the infrastructure grows or undergoes changes over time, which is a common situation in Cloud environments.<\/p>\n<p style=\"font-weight: 400;\">&#8220;Standard&#8221; metrics and information provided by the job scheduler might not be sufficient to efficiently manage the Cloud clusters. For example, tracking the cost of running jobs becomes even more important in order to monitor and manage your budget, and redistribute the costs to your users\/departments. Due to the wide variety of compute instance types in the cloud, it can also be interesting to track on which instance types the jobs have run, in order to check their performances and associated costs, and further improve the placement and instance selection of the jobs.<\/p>\n<p style=\"font-weight: 400;\">OKA offers many benefits to monitor your jobs, and deep-dive into how your clusters behave and how they are being used by your end-users. Accessing in OKA information about the cloud is straightforward, if you have configured your environment properly. In this article, we present a simple integration that can be made in a Slurm cluster in AWS to retrieve the type of instances jobs runs on, their pricing information (on-demand\/spot, per hour price&#8230;), the AWS region, and virtually any information about the AWS environment you are using.<br \/>\nThe scripts provided below are given as examples, and can easily be adapted to retrieve more detailed information, or be adapted to work with other job schedulers (e.g., LSF, PBS&#8230;).<\/p>\n<\/div><div class=\"fusion-text fusion-text-3\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">There are many ways to create a cluster in AWS, the details are out of the scope of this article, but you can use for example <span style=\"text-decoration: underline;\"><a href=\"https:\/\/docs.aws.amazon.com\/parallelcluster\/index.html\" target=\"_blank\" rel=\"noopener\">AWS ParallelCluster<\/a><\/span> or <span style=\"text-decoration: underline;\"><a href=\"https:\/\/ucit.fr\/index.php\/ccme\/\" target=\"_blank\" rel=\"noopener\">CCME<\/a><\/span>.<\/p>\n<\/div><div class=\"fusion-text fusion-text-4\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><blockquote>\n<p>Note: the solution presented here is extracted from CCME where it is available out of the box.<\/p>\n<\/blockquote>\n<\/div><div class=\"elegant-empty-space space-vertical fusion-clearfix \" style=\"height:80px;\"><\/div><div class=\"fusion-text fusion-text-5\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">The principle depicted here is very simple, and relies on two components:<\/p>\n<div>\n<ol>\n<li style=\"font-weight: 400;\">A Slurm <span style=\"text-decoration: underline;\"><a href=\"https:\/\/slurm.schedmd.com\/prolog_epilog.html\" target=\"_blank\" rel=\"noopener\">epilog script<\/a><\/span> that will gather information about the AWS environment on which the job runs, and store this information as comma separated values (CSV) in the <span style=\"text-decoration: underline;\"><a href=\"https:\/\/slurm.schedmd.com\/scontrol.html#OPT_Comment\" target=\"_blank\" rel=\"noopener\">Comment<\/a><\/span> field of the job. The gathered information are:\n<ul>\n<li>instance type<\/li>\n<li>instance id of the &#8220;main&#8221; job node<\/li>\n<li>availability zone<\/li>\n<li>region<\/li>\n<li>instance price<\/li>\n<li>cost type: ondemand or spot<\/li>\n<li>tenancy: shared, reserved&#8230;<\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\">An OKA Data Enhancer that will parse the values of the <code>Comment<\/code> field, and store them as additional information with each job.<\/li>\n<\/ol>\n<\/div>\n<\/div><div class=\"elegant-empty-space space-vertical fusion-clearfix \" style=\"height:80px;\"><\/div><div class=\"elegant-image elegant-image-0 elegant-align-center \"><div class=\"elegant-image-wrapper\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration-800x312.png\" alt=\"\" style=\"width:800px;\"\/><\/div><div class=\"elegant-image-blur-shadow\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration-800x312.png\" alt=\"\" style=\"width:800px;\"\/><\/div><style type=\"text\/css\"><\/style><\/div><div class=\"fusion-text fusion-text-6\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><blockquote>\n<p>The principle depicted here can also easily adapted to other Cloud providers. For example, you could follow the indications presented in the Azure integration with Slurm presented <span style=\"text-decoration: underline;\"><a href=\"https:\/\/techcommunity.microsoft.com\/t5\/azure-compute-blog\/enabling-job-accounting-for-slurm-with-azure-cyclecloud-8-2-and\/ba-p\/3413803\" target=\"_blank\" rel=\"noopener\">here<\/a><\/span> in the &#8220;Granular Cost Control&#8221; section.<\/p>\n<\/blockquote>\n<\/div><div class=\"fusion-title title fusion-title-2 fusion-sep-none fusion-title-text fusion-title-size-two\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:42.5;line-height:1.4;\">Slurm epilog script<\/h2><\/div><div class=\"fusion-text fusion-text-7\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">This Slurm epilog script retrieves information about the instance type and its pricing when the job ends,<br \/>\nand stores the information in the <code>Comment<\/code> field of the job in <code>sacct<\/code>. The user provided comments are kept, and the information are added at the end after a semicolon. The format of the <code>Comment<\/code> field is the following:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-1 > .CodeMirror, .fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters {background-color:#fcfcfc;}.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters { background-color: #e8e8e8; }.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-1 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:#e0dede;\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_1\" style=\"font-size:14px;\">Copy to clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_1\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_1\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\">:PricingInfo=${instance type};${instance id};${availability zone};${region};${instance price};${cost type};${tenancy}<\/textarea><\/div><div class=\"elegant-empty-space space-vertical fusion-clearfix \" style=\"height:100px;\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-4 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-4\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-3 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-blend:overlay;--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-8\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">The following packages are required and should be available on all the nodes of the cluster:<\/p>\n<div>\n<ul>\n<li><a href=\"https:\/\/stedolan.github.io\/jq\/\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">jq<\/span><\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/getting-started-install.html\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">awscli<\/span><\/a><\/li>\n<\/ul>\n<\/div>\n<\/div><div class=\"fusion-text fusion-text-9\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">Also note that this solution requires that Slurm has been configured to keep accounting information about the jobs. See <span style=\"text-decoration: underline;\"><a href=\"https:\/\/slurm.schedmd.com\/accounting.html\" target=\"_blank\" rel=\"noopener\">Slurm documentation<\/a><\/span> to configure accounting manually, or if you are using AWS ParallelCluster you can follow <span style=\"text-decoration: underline;\"><a href=\"https:\/\/docs.aws.amazon.com\/parallelcluster\/latest\/ug\/slurm-accounting-v3.html\" target=\"_blank\" rel=\"noopener\">this guide<\/a><\/span>.<\/p>\n<\/div><div class=\"fusion-text fusion-text-10\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">As the epilog script contacts AWS APIs to gather the information, it needs to run on instances having (at least) the following policy attached to the <span style=\"text-decoration: underline;\"><a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/iam-roles-for-amazon-ec2.html\" target=\"_blank\" rel=\"noopener\">role of the instance<\/a><\/span>:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-2 > .CodeMirror, .fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters {background-color:#fcfcfc;}.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters { background-color: #e8e8e8; }.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-2 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:#e0dede;\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_2\" style=\"font-size:14px;\">Copy to clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_2\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_2\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"application\/json\">{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n  {\n    \"Sid\": \"VisualEditor0\",\n    \"Effect\": \"Allow\",\n    \"Action\": [\n    \"ec2:DescribeSpotPriceHistory\",\n    \"ec2:DescribeInstances\",\n    \"ec2:DescribeRegions\",\n    \"pricing:GetProducts\"\n    ],\n    \"Resource\": \"*\"\n  }\n  ]\n}<\/textarea><\/div><div class=\"elegant-empty-space space-vertical fusion-clearfix \" style=\"height:80px;\"><\/div><div class=\"fusion-title title fusion-title-3 fusion-sep-none fusion-title-text fusion-title-size-four\"><h4 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:28;line-height:1.5;\">Script<\/h4><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-3 > .CodeMirror, .fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters {background-color:#fcfcfc;}.fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters { background-color: #e8e8e8; }.fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-3 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:#e0dede;\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_3\" style=\"font-size:14px;\">Copy to clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_3\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_3\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-sh\">#!\/bin\/bash\ndeclare logFile=\"\/var\/log\/ccme.slurmepilog.log\"\ntouch \"${logFile}\"; chmod -v 600 \"${logFile}\"\nexec  > >(awk '{printf \"[%s] %s\\n\", strftime(\"%FT%T%z\"), $0; fflush()}' >>\"${logFile}\" || true)\nexec 2>&1;\n# Uncomment the following line for debug traces\n#set -x\n\nslurm_env=\"\/opt\/slurm\/etc\/slurm.sh\"\nif [[ -f \"${slurm_env}\" ]]; then\n  # shellcheck source=\/dev\/null\n  . \"${slurm_env}\"\nfi\n\ndeclare -A regions\nregions[\"af-south-1\"]=\"Africa (Cape Town)\"\nregions[\"ap-east-1\"]=\"Asia Pacific (Hong Kong)\"\nregions[\"ap-east-1\"]=\"Asia Pacific (Hong Kong)\"\nregions[\"ap-northeast-1\"]=\"Asia Pacific (Tokyo)\"\nregions[\"ap-northeast-2\"]=\"Asia Pacific (Seoul)\"\nregions[\"ap-south-1\"]=\"Asia Pacific (Mumbai)\"\nregions[\"ap-south-2\"]=\"Asia Pacific (Hyderabad)\"\nregions[\"ap-southeast-1\"]=\"Asia Pacific (Singapore)\"\nregions[\"ap-southeast-2\"]=\"Asia Pacific (Sydney)\"\nregions[\"ap-southeast-3\"]=\"Asia Pacific (Jakarta)\"\nregions[\"ap-southeast-4\"]=\"Asia Pacific (Melbourne)\"\nregions[\"ca-central-1\"]=\"Canada (Central)\"\nregions[\"eu-central-1\"]=\"EU (Frankfurt)\"\nregions[\"eu-central-2\"]=\"Europe (Zurich)\"\nregions[\"eu-north-1\"]=\"EU (Stockholm)\"\nregions[\"eu-south-1\"]=\"Europe (Milan)\"\nregions[\"eu-south-2\"]=\"Europe (Spain)\"\nregions[\"eu-west-1\"]=\"EU (Ireland)\"\nregions[\"eu-west-2\"]=\"EU (London)\"\nregions[\"eu-west-3\"]=\"EU (Paris)\"\nregions[\"me-central-1\"]=\"Middle East (UAE)\"\nregions[\"me-south-1\"]=\"Middle East (Bahrain)\"\nregions[\"sa-east-1\"]=\"South America (Sao Paulo)\"\nregions[\"us-east-1\"]=\"US East (N. Virginia)\"\nregions[\"us-east-2\"]=\"US East (Ohio)\"\nregions[\"us-west-1\"]=\"US West (N. California)\"\nregions[\"us-west-2\"]=\"US West (Oregon)\"\n\n# Gather Information about job environment on AWS\nTOKEN=$(curl -X PUT \"http:\/\/169.254.169.254\/latest\/api\/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ninsttype=$(curl -s -H \"X-aws-ec2-metadata-token: ${TOKEN}\" -v http:\/\/169.254.169.254\/latest\/meta-data\/instance-type)\ninstid=$(curl -s  -H \"X-aws-ec2-metadata-token: ${TOKEN}\" -v http:\/\/169.254.169.254\/latest\/meta-data\/instance-id)\naz=$(curl -s -H \"X-aws-ec2-metadata-token: ${TOKEN}\" -v http:\/\/169.254.169.254\/latest\/meta-data\/placement\/availability-zone)\nregion=$(curl -s -H \"X-aws-ec2-metadata-token: ${TOKEN}\" -v http:\/\/169.254.169.254\/latest\/dynamic\/instance-identity\/document | jq -r .region || true)\n\n\n# We try to detect if we use spot through AWS APIs\n# https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/instance-purchasing-options.html#check-instance-lifecycle\n# Use the following describe-instances command:\n# aws ec2 describe-instances --instance-ids i-1234567890abcdef0\n# - If the instance is running on a Dedicated Host, the output contains the following information: \"Tenancy\": \"host\"\n# - If the instance is a Dedicated Instance, the output contains the following information: \"Tenancy\": \"dedicated\"\n# - If the instance is a Spot Instance, the output contains the following information: \"InstanceLifecycle\": \"spot\"\n# - If the instance is a Scheduled Instance, the output contains the following information: \"InstanceLifecycle\": \"scheduled\"\n# - Otherwise, the output does not contain InstanceLifecycle.\nlifecycle=$(aws --region=\"${region}\" ec2 describe-instances --instance-ids \"${instid}\" | jq -r \".Reservations[0].Instances[0].InstanceLifecycle\" || true)\ntenancy=$(aws --region=\"${region}\" ec2 describe-instances --instance-ids \"${instid}\" | jq -r \".Reservations[0].Instances[0].Placement.Tenancy\" || true)\n\ncosttype=\"ondemand\"  # Default value\nif [[ \"${lifecycle}\" == \"spot\" ]]; then\n  costtype=\"spot\"\nelif [[ \"${lifecycle}\" == \"\" ]]; then\n  costtype=\"ondemand\"\nfi\n\n# Get instance price\nif [[ \"${costtype}\" == \"ondemand\" ]]; then\n  if [[ \"${tenancy}\" == \"default\" ]]; then\n    tenancy=\"shared\"\n  fi\n\n  filters=(\n  \"Type=TERM_MATCH,Field=instanceType,Value=${insttype}\"\n  \"Type=TERM_MATCH,Field=location,Value=${regions[${region}]}\"\n  \"Type=TERM_MATCH,Field=operatingSystem,Value=Linux\"\n  \"Type=TERM_MATCH,Field=preInstalledSw,Value=NA\"\n  \"Type=TERM_MATCH,Field=capacitystatus,Value=Used\"\n  \"Type=TERM_MATCH,Field=tenancy,Value=${tenancy}\"\n  )\n  # Warning: if tenancy==host (reserved), then the price will be $0.00\n  instprice=$(aws --region=us-east-1 pricing get-products --service-code AmazonEC2 --filter \"${filters[@]}\" | jq -rc '.PriceList[0]' | jq -r '[.terms.OnDemand[].priceDimensions[].pricePerUnit.USD][0]' || true)\nelif [[ \"${costtype}\" == \"spot\" ]]; then\n  instprice=$(aws --region \"${region}\" ec2 describe-spot-price-history --availability-zone \"${az}\" --instance-types \"${insttype}\" --start-time \"$(date '+%Y-%m-%dT%H:%M:%S')\" --product-descriptions \"Linux\/UNIX\" | jq -r '.SpotPriceHistory[0].SpotPrice' || true)\nelse\n  # Currently we do not manage other types of pricing\n  instprice=0\nfi\n\n# shellcheck disable=SC2154\ncomment=$(scontrol show job \"${SLURM_JOBID}\" | grep 'Comment=' | awk -F'Comment=' '{print $2}' || true)\ncomment+=\":PricingInfo=${insttype};${instid};${az};${region};${instprice};${costtype};${tenancy}\"\n\necho \"Setting comment for job ${SLURM_JOBID}: ${comment}\"\n\nsacctmgr -i -Q modify job where JobID=\"${SLURM_JOBID}\" set Comment=\"${comment}\"<\/textarea><\/div><div class=\"elegant-empty-space space-vertical fusion-clearfix \" style=\"height:80px;\"><\/div><div class=\"fusion-title title fusion-title-4 fusion-sep-none fusion-title-text fusion-title-size-four\"><h4 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:28;line-height:1.5;\">Installation<\/h4><\/div><div class=\"fusion-text fusion-text-11\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><ul>\n<li style=\"font-weight: 400;\">Copy the epilog script to a folder accessible on all nodes, e.g., <code>\/shared_nfs\/slurm\/slurm-epilog.sh<\/code>, and give it execution rights: <code>chmod +x \/shared_nfs\/slurm\/slurm-epilog.sh<\/code><\/li>\n<li style=\"font-weight: 400;\">Edit <code>\/etc\/slurm\/slurm.conf<\/code> (on all nodes), and set the <code>Epilog<\/code> option to <code>\/shared_nfs\/slurm\/slurm-epilog.sh<\/code><\/li>\n<li style=\"font-weight: 400;\">Reconfigure Slurm daemons: <code>scontrol reconfigure<\/code>, or restart them: <code>systemctl restart slurmd<\/code><\/li>\n<\/ul>\n<\/div><div class=\"fusion-text fusion-text-12\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">Then submit a job. Once finished, check that in the output of <code>sacct<\/code> you have in the <code>Comment<\/code> field the expected output:<br \/>\n<code>sacct --format \"jobid,comment\"<\/code>.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-5 fusion-sep-none fusion-title-text fusion-title-size-two\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:42.5;line-height:1.4;\">OKA Data Enhancer<\/h2><\/div><div class=\"fusion-text fusion-text-13\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">A <span style=\"text-decoration: underline;\"><a href=\"https:\/\/doc.oka.how\/admin_guide\/configuration\/data_enhancers.html#data-enhancers\" target=\"_blank\" rel=\"noopener\">Data Enhancer<\/a><\/span> needs to be created and configured in OKA in order to parse the additional data gathered by the Slurm Epilog script. We propose here an example Data Enhancer that you can adapt to your needs (included in comment is the generation of &#8220;fake&#8221; data if you wish to test it first):<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-4 > .CodeMirror, .fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters {background-color:#fcfcfc;}.fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters { background-color: #e8e8e8; }.fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-4 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:#e0dede;\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_4\" style=\"font-size:14px;\">Copy to clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_4\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_4\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-less\">import logging\n    import numpy as np\n\n    logger = logging.getLogger(\"oka_main\")\n\n    class EnhancerAWSSLURMFeature():\n        VERSION = \"1.0.0\"\n\n        def parse_comment(comment):\n            # :pricinginfo=${instance type};${instance id};${availability zone};${region};${price};${spot|ondemand};{tenancy}\n            # e.g., :pricinginfo=c5n.18xlarge;i-0cd3c13fa4599d4d5;eu-west-1b;eu-west-1;1.241400;spot;shared\n            scsv = comment.split(':pricinginfo=')[1].split(';')\n            insttype = scsv[0]\n            instid = scsv[1]\n            az = scsv[2]\n            region = scsv[3]\n            instprice = float(scsv[4]) if scsv[4].lower() not in [\"na\", \"nan\"] else 0.0\n            costtype = scsv[5]\n            tenancy = scsv[6]\n            return insttype, instid, az, region, instprice, costtype, tenancy\n\n\n        def run(self, data, **kwargs):\n            try:\n                # Uncomment the following lines for testing with fake data\n                # from random import random, randint\n                # azs = [[\"a\", \"b\", \"c\"][randint(0,2)] for y in range(len(data))]\n                # prices = [random() for y in range(len(data))]\n                # inst = [[\"c5n.18xlarge\", \"c5n.9xlarge\", \"c5n.4xlarge\", \"c5.4xlarge\", \"g4dn.8xlarge\"][randint(0,4)] for y in range(len(data))]\n                # data.loc[:, \"Comment\"] = [\"comment:pricinginfo={};id12;eu-west-1{};eu-west-1;{};spot;shared\".format(inst[x], azs[x], prices[x]) for x in range(len(data))]\n\n                # Fill missing values with a set of default values\n                data[\"Comment\"].fillna(\":pricinginfo=NA;NA;NA;NA;0;ondemand;shared\", inplace=True)\n\n                data.loc[:, \"instance_type\"], data.loc[:, \"instance_id\"], data.loc[:, \"availability_zone\"], data.loc[:, \"region\"], instprice, data.loc[:, \"price_type\"], data.loc[:, \"tenancy\"] = zip(*data[\"Comment\"].apply(EnhancerAWSSLURMFeature.parse_comment))\n\n                duration = (data[\"End\"].astype(np.datetime64) - data[\"Start\"].astype(np.datetime64)).astype('timedelta64[s]')\/3600.0\n                data.loc[:, \"Cost\"] = instprice * duration * data[\"Allocated_Nodes\"]\n\n            except Exception as e:\n                logger.error(f\"Cost information not available: {e}\")<\/textarea><\/div><div class=\"elegant-empty-space space-vertical fusion-clearfix \" style=\"height:80px;\"><\/div><div class=\"fusion-title title fusion-title-6 fusion-sep-none fusion-title-text fusion-title-size-four\"><h4 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:28;line-height:1.5;\">Installation<\/h4><\/div><div class=\"fusion-text fusion-text-14\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">Please refer to the <span style=\"text-decoration: underline;\"><a href=\"https:\/\/doc.oka.how\/admin_guide\/configuration\/data_enhancers.html#data-enhancers\" target=\"_blank\" rel=\"noopener\">Data Enhancer<\/a><\/span> section for explanations on how to install and configure this Data Enhancer in the ingestion pipeline.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-7 fusion-sep-none fusion-title-text fusion-title-size-two\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:42.5;line-height:1.4;\">Accessing AWS information in OKA<\/h2><\/div><div class=\"fusion-text fusion-text-15\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">The information ingested through the Data Enhancer are then available in OKA in multiple plugins and through the filters.<br \/>\nWe present below a few examples of where the information can be accessed and used to analyze your workloads:<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-5 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-5\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-margin-top:60px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-4 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"elegant-image elegant-image-1 elegant-align-center \"><div class=\"elegant-image-wrapper\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_kpi-800x428.png\" alt=\"\" style=\"width:800px;\"\/><\/div><div class=\"elegant-image-blur-shadow\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_kpi-800x428.png\" alt=\"\" style=\"width:800px;\"\/><\/div><style type=\"text\/css\"><\/style><\/div><div class=\"fusion-text fusion-text-16\" style=\"--awb-content-alignment:center;\"><div>\n<div>AWS costs in <a href=\"https:\/\/doc.oka.how\/user_guide\/kpi\/index.html#kpi\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">KPI<\/span><\/a><\/div>\n<\/div>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-5 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:80px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-17\" style=\"--awb-content-alignment:center;\"><div>\n<div><span style=\"text-decoration: underline;\"><a href=\"https:\/\/doc.oka.how\/user_guide\/filters\/index.html#filters\" target=\"_blank\" rel=\"noopener\">Filters<\/a><\/span> allow to select workloads based on the information gathered from AWS.<\/div>\n<\/div>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-6 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:80px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"elegant-image elegant-image-2 elegant-align-center \"><div class=\"elegant-image-wrapper\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_consumers-800x450.png\" alt=\"\" style=\"width:800px;\"\/><\/div><div class=\"elegant-image-blur-shadow\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_consumers-800x450.png\" alt=\"\" style=\"width:800px;\"\/><\/div><style type=\"text\/css\"><\/style><\/div><div class=\"fusion-text fusion-text-18\" style=\"--awb-content-alignment:center;\"><p>Detailed information in <span style=\"text-decoration: underline;\"><a href=\"https:\/\/doc.oka.how\/user_guide\/oka_plugins\/consumers.html#plugin-consumers\" target=\"_blank\" rel=\"noopener\">Plugin Consumers<\/a><\/span><\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-7 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:80px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"elegant-image elegant-image-3 elegant-align-center \"><div class=\"elegant-image-wrapper\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_state-800x432.png\" alt=\"\" style=\"width:800px;\"\/><\/div><div class=\"elegant-image-blur-shadow\"><img decoding=\"async\" src=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_state-800x432.png\" alt=\"\" style=\"width:800px;\"\/><\/div><style type=\"text\/css\"><\/style><\/div><div class=\"fusion-text fusion-text-19\" style=\"--awb-content-alignment:center;\"><p>Cost per job status in <span style=\"text-decoration: underline;\"><a href=\"https:\/\/doc.oka.how\/user_guide\/oka_plugins\/state.html#plugin-state\" target=\"_blank\" rel=\"noopener\">Plugin State<\/a><\/span> to detect waste.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-6 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-6\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-margin-top:80px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-8 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-8 fusion-sep-none fusion-title-text fusion-title-size-two\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:42.5;line-height:1.4;\">Conclusion<\/h2><\/div><div class=\"fusion-text fusion-text-20\" style=\"--awb-text-color:#24587a;--awb-text-font-family:&quot;Roboto&quot;;--awb-text-font-style:normal;--awb-text-font-weight:100;\"><p style=\"font-weight: 400;\">This article presented a simple integration approach for a Slurm cluster in AWS. By leveraging a Slurm epilog script and an OKA Data Enhancer, valuable information about the AWS environment can be retrieved and analyzed.<\/p>\n<p style=\"font-weight: 400;\">By utilizing the integrated AWS information in OKA, administrators gain access to various plugins and filters for analyzing and visualizing workloads. This enables better cost management, granular control, and identification of wasteful practices.<\/p>\n<p style=\"font-weight: 400;\">Overall, the integration of an AWS cluster with OKA empowers administrators to optimize their HPC infrastructure, gain insights into resource utilization and costs, and make data-driven decisions for efficient cluster management in cloud environments.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-7 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling gradient-container-7\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1216.8px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-9 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-blend:overlay;--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-21\"><p><\/p>\n<\/div><\/div><\/div><\/div><\/div><\/p>","protected":false},"excerpt":{"rendered":"<p>In this article, we present a simple integration that can be made in a Slurm cluster in AWS to retrieve the type of instances jobs runs on, their pricing information (on-demand\/spot, per hour price\u2026), the AWS region, and virtually any information about the AWS environment you are using.<\/p>\n","protected":false},"author":1,"featured_media":14973,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[97,94],"tags":[],"class_list":["post-15081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-oka"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Integrating the OKA Suite with your AWS cluster - UCit<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integrating the OKA Suite with your AWS cluster - UCit\" \/>\n<meta property=\"og:description\" content=\"In this article, we present a simple integration that can be made in a Slurm cluster in AWS to retrieve the type of instances jobs runs on, their pricing information (on-demand\/spot, per hour price\u2026), the AWS region, and virtually any information about the AWS environment you are using.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/\" \/>\n<meta property=\"og:site_name\" content=\"UCit\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-08T14:05:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-07T14:12:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration.png\" \/>\n\t<meta property=\"og:image:width\" content=\"4280\" \/>\n\t<meta property=\"og:image:height\" content=\"1668\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ucitdev\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ucitdev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"22 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/\"},\"author\":{\"name\":\"ucitdev\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/#\\\/schema\\\/person\\\/8fc5d5092628810fbbb9c88ad5635752\"},\"headline\":\"Integrating the OKA Suite with your AWS cluster\",\"datePublished\":\"2023-08-08T14:05:44+00:00\",\"dateModified\":\"2023-09-07T14:12:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/\"},\"wordCount\":13785,\"image\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ucit.fr\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/aws_integration.png\",\"articleSection\":[\"Articles\",\"OKA\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/\",\"url\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/\",\"name\":\"Integrating the OKA Suite with your AWS cluster - UCit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ucit.fr\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/aws_integration.png\",\"datePublished\":\"2023-08-08T14:05:44+00:00\",\"dateModified\":\"2023-09-07T14:12:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/#\\\/schema\\\/person\\\/8fc5d5092628810fbbb9c88ad5635752\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[[\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/\"]]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ucit.fr\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/aws_integration.png\",\"contentUrl\":\"https:\\\/\\\/ucit.fr\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/aws_integration.png\",\"width\":4280,\"height\":1668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/2023\\\/08\\\/08\\\/integrating-the-oka-suite-with-your-aws-cluster\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/ucit.fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integrating the OKA Suite with your AWS cluster\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/#website\",\"url\":\"https:\\\/\\\/ucit.fr\\\/\",\"name\":\"UCit\",\"description\":\"Toward an optimized HPC environment\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ucit.fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ucit.fr\\\/#\\\/schema\\\/person\\\/8fc5d5092628810fbbb9c88ad5635752\",\"name\":\"ucitdev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d7eebb4258b39c3559114e33dc5b901ac44ff55a073f79b0b6d2bda25b1f37a8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d7eebb4258b39c3559114e33dc5b901ac44ff55a073f79b0b6d2bda25b1f37a8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d7eebb4258b39c3559114e33dc5b901ac44ff55a073f79b0b6d2bda25b1f37a8?s=96&d=mm&r=g\",\"caption\":\"ucitdev\"},\"url\":\"https:\\\/\\\/ucit.fr\\\/index.php\\\/author\\\/ucitdev\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integrating the OKA Suite with your AWS cluster - UCit","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/","og_locale":"en_US","og_type":"article","og_title":"Integrating the OKA Suite with your AWS cluster - UCit","og_description":"In this article, we present a simple integration that can be made in a Slurm cluster in AWS to retrieve the type of instances jobs runs on, their pricing information (on-demand\/spot, per hour price\u2026), the AWS region, and virtually any information about the AWS environment you are using.","og_url":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/","og_site_name":"UCit","article_published_time":"2023-08-08T14:05:44+00:00","article_modified_time":"2023-09-07T14:12:42+00:00","og_image":[{"width":4280,"height":1668,"url":"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration.png","type":"image\/png"}],"author":"ucitdev","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ucitdev","Est. reading time":"22 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#article","isPartOf":{"@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/"},"author":{"name":"ucitdev","@id":"https:\/\/ucit.fr\/#\/schema\/person\/8fc5d5092628810fbbb9c88ad5635752"},"headline":"Integrating the OKA Suite with your AWS cluster","datePublished":"2023-08-08T14:05:44+00:00","dateModified":"2023-09-07T14:12:42+00:00","mainEntityOfPage":{"@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/"},"wordCount":13785,"image":{"@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#primaryimage"},"thumbnailUrl":"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration.png","articleSection":["Articles","OKA"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/","url":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/","name":"Integrating the OKA Suite with your AWS cluster - UCit","isPartOf":{"@id":"https:\/\/ucit.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#primaryimage"},"image":{"@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#primaryimage"},"thumbnailUrl":"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration.png","datePublished":"2023-08-08T14:05:44+00:00","dateModified":"2023-09-07T14:12:42+00:00","author":{"@id":"https:\/\/ucit.fr\/#\/schema\/person\/8fc5d5092628810fbbb9c88ad5635752"},"breadcrumb":{"@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":[["https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/"]]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#primaryimage","url":"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration.png","contentUrl":"https:\/\/ucit.fr\/wp-content\/uploads\/2023\/07\/aws_integration.png","width":4280,"height":1668},{"@type":"BreadcrumbList","@id":"https:\/\/ucit.fr\/index.php\/2023\/08\/08\/integrating-the-oka-suite-with-your-aws-cluster\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/ucit.fr\/"},{"@type":"ListItem","position":2,"name":"Integrating the OKA Suite with your AWS cluster"}]},{"@type":"WebSite","@id":"https:\/\/ucit.fr\/#website","url":"https:\/\/ucit.fr\/","name":"UCit","description":"Toward an optimized HPC environment","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ucit.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ucit.fr\/#\/schema\/person\/8fc5d5092628810fbbb9c88ad5635752","name":"ucitdev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d7eebb4258b39c3559114e33dc5b901ac44ff55a073f79b0b6d2bda25b1f37a8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d7eebb4258b39c3559114e33dc5b901ac44ff55a073f79b0b6d2bda25b1f37a8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d7eebb4258b39c3559114e33dc5b901ac44ff55a073f79b0b6d2bda25b1f37a8?s=96&d=mm&r=g","caption":"ucitdev"},"url":"https:\/\/ucit.fr\/index.php\/author\/ucitdev\/"}]}},"_links":{"self":[{"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/posts\/15081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/comments?post=15081"}],"version-history":[{"count":2,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/posts\/15081\/revisions"}],"predecessor-version":[{"id":15083,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/posts\/15081\/revisions\/15083"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/media\/14973"}],"wp:attachment":[{"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/media?parent=15081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/categories?post=15081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucit.fr\/index.php\/wp-json\/wp\/v2\/tags?post=15081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}