Skip to content

Add Kubernetes native launcher#30

Open
nicodr97 wants to merge 12 commits into
devfrom
yasirmaqsood-kubernetes
Open

Add Kubernetes native launcher#30
nicodr97 wants to merge 12 commits into
devfrom
yasirmaqsood-kubernetes

Conversation

@nicodr97
Copy link
Copy Markdown
Collaborator

Solved conflicts from #29

{
// ---------------------------------------------------------------
// Instance properties
// ---------------------------------------------------------------
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to avoid having more comments than needed, so remove this "instance properties" lines because it's evident what they are

// Instance properties
// ---------------------------------------------------------------

/** @var string Kubernetes Job name, also used as the OpenVRE "pid" */
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the same principle, we might simplify these comments at some point but let's keep them because they are usefull right now

// ---------------------------------------------------------------

/** @var string Kubernetes Job name, also used as the OpenVRE "pid" */
private $pid = "";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the class properties to have the type as part oh the property, not as part of the comment. E.g.

/** Kubernetes Job name, also used as the OpenVRE "pid" */
private string $pid = "";

This way the type is enforced automatically

* @param array $jobOptions Options from Tooljob: "image" overrides container image,
* "env" provides extra environment variables for the pod
*/
public function __construct($cl = false, $workDir = "", $queue = "", $jobname = "", $cpu = 1, $mem = 0, $logFile = "job_output.log", $errFile = "job_error.log", $jobOptions = array())
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the parameters that are not used: queue, logFIle and errFile

* @param array $jobOptions Options from Tooljob: "image" overrides container image,
* "env" provides extra environment variables for the pod
*/
public function __construct($cl = false, $workDir = "", $queue = "", $jobname = "", $cpu = 1, $mem = 0, $logFile = "job_output.log", $errFile = "job_error.log", $jobOptions = array())
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as beofre for the types, add them to the contruct function and remove from the comments

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all the functions with parameters: add the types to the contruct function and remove from the comments

" --out_metadata " . $this->stageout_file_virtual .
" --log_file " . $this->log_file_virtual;

if (isset($this->launcher) && $this->launcher === "kubernetes_native") {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The launcher kubernetes_native never does not call this function setBashCommandDockerSge so this condition cannot happen

Comment thread front_end/Dockerfile
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer self-update
RUN composer update --ignore-platform-req=ext-mongodb --ignore-platform-req=ext-mongodb
# Dependencies are pre-seeded in ./openVRE/vendor for offline/reproducible builds.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing this? The dependencies are defined in composer.json and are versioned, so the builds should be reproducible

Comment thread sge/Dockerfile
#RUN groupmod -g $DOCKER_GROUP docker
#RUN usermod -aG docker application

ARG DOCKER_GROUP=1002
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already in the .env file

Comment thread sge/Dockerfile
else \
groupadd -g "${DOCKER_GROUP}" docker; \
fi; \
usermod -aG docker application
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker group already exists at this point so I would keep the old code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants