[slurm-users] Change something in user's script using job_submit.lua plugin

2023-10-26 Thread Paulo Jose Braga Estrela
Hi,

Is it possible to change something in user's sbatch script by using a 
job_submit plugin? To be more specific, using Lua job_submit plugin.

I'm trying to do the following in job_submit.lua when a user changes job's 
partition to "cloud" partition, but the script got executed without 
modification.

function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)

if job_desc.partition == "cloud" then
slurm.log_info("slurm_job_modify: Bursting job %u from uid %u 
to the cloud...",job_rec.job_id,modify_uid)

script = job_rec.script
slurm.log_info("Script BEFORE change: %s",script)

-- changing user command to another command
script = string.gsub(script,"local command","cloud command")

slurm.log_info("Script AFTER change %s",script)
-- The script variable is really changed

job_rec.script = script
slurm.log_info("Job RECORD SCRIPT %s",job_rec.script)
-- The job record also got changed, but the EXECUTED script 
isn't changed at all. It runs without modification.
end

return slurm.SUCCESS
end




PAULO ESTRELA

Analista de Sistemas Sênior
PETROBRAS - Tecnologia da Informação e Telecomunicações
Suporte e Operação de Soluções de Alto Desempenho (HPC)
TIC/OI/SSH/SAD


O emitente desta mensagem é responsável por seu conteúdo e endereçamento e deve 
observar as normas internas da Petrobras. Cabe ao destinatário assegurar que as 
informações e dados pessoais contidos neste correio eletrônico somente sejam 
utilizados com o grau de sigilo adequado e em conformidade com a legislação de 
proteção de dados e privacidade aplicável. A utilização das informações e dados 
pessoais contidos neste correio eletrônico em desconformidade com as normas 
aplicáveis acarretará a aplicação das sanções cabíveis.

The sender of this message is responsible for its content and address and must 
comply with Petrobras' internal rules. It is up to the recipient to ensure that 
the information and personal data contained in this email are only used with 
the appropriate degree of confidentiality and in compliance with applicable 
data protection and privacy legislation. The use of the information and 
personal data contained in this e-mail in violation of the applicable rules 
will result in the application of the applicable sanctions.

El remitente de este mensaje es responsable por su contenido y dirección y debe 
cumplir con las normas internas de Petrobras. Corresponde al destinatario 
asegurarse de que la información y los datos personales contenidos en este 
correo electrónico solo se utilicen con el grado adecuado de confidencialidad y 
de conformidad con la legislación aplicable en materia de privacidad y 
protección de datos. El uso de la información y datos personales contenidos en 
este correo electrónico en contravención de las normas aplicables dará lugar a 
la aplicación de las sanciones correspondientes.


PÚBLICA


[slurm-users] job_container/tmpfs and rootless apptainer

2023-10-26 Thread Roberto Monti
Hi,
I was wondering if some light could be shed as to why permissions on the 
mounted /tmp need to be 700 when using the job_container/tmpfs plugin.

I'm asking this because we are considering allowing for users to run rootless 
apptainer as a method for building containers from a slurm job, and I'm 
encountering the following issues:
- 0700 permissions on /tmp do not sit well with certain builds (e.g. ubuntu 
images needing to write temp files in order to run "apt")
- setting the APPTAINER_TMPDIR variable would in theory circumvent this, but I 
can't do this as it needs to be on disk, and all the other fs I have available 
are networked

I have "solved" this by giving 1777 permissions to the mounted /tmp in the 
taskprolog, which was the only option I could find, as both prolog and 
init_script get to run prior to the construction of the /tmp namespace. Does 
this look like an appropriate solution?

Best regards,

--
Roberto P. Monti
DevOps Engineer I
roberto.mo...@jax.org

The Jackson Laboratory
United States | China | Japan
www.jax.org

---

The information in this email, including attachments, may be confidential and 
is intended solely for the addressee(s). If you believe you received this email 
by mistake, please notify the sender by return email as soon as possible.