Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

268
Visualizações
Nomad : raw_exec install nginx

I want to run raw_exec to install an nginx , is this possible? or how can this be done by raw_exec only. since this code will not start/run.

job "raw-exec" {
  datacenters = ["dc1"]
  type        = "service"

  group "exec" {
    count = 1

    update {
       max_parallel      = 1
       min_healthy_time  = "10s"
       healthy_deadline  = "5m"
       progress_deadline = "10m"
       auto_revert       = true
     }

    task "raw-exec-test" {
      driver = "raw_exec"

      config {
        command = "/bin/apt"
        args = ["-y", "install", "nginx.service"]
      }

      resources {
        cpu    = 100
        memory = 125
      }

    }
  }
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Without a job status it is hard to troubleshoot what's wrong. nomad job status raw-exec would show your job status. It will also show allocations created by the job. You can check what's wrong with the allocations (set of tasks in a job should be run on a particular node) that Nomad creates by nomad alloc status YOUR-ALLOC-ID.

I've run the following Nomad job specification and it worked well on my MacBook. I ran nomad using nomad agent -dev in one terminal window, then created the file test.job in another terminal window and ran nomad job run test.job and it installed htop software on the MacBook.

job "raw-exec" {
  datacenters = ["dc1"]
  type        = "batch"

  group "exec" {
    count = 1

    task "raw-exec-test" {
      driver = "raw_exec"

      config {
        command = "brew"
        args = ["install", "htop"]
      }

      resources {
        cpu    = 100
        memory = 125
      }
    }
  }
}

Notice that I've changed job type from service to batch. Batch jobs are designed to run once while services should be up and running all the time. I suppose that you want your apt install -y nginx command to run only once. You can read more about job types here.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda