-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
创建R应用报错 #1078
Comments
在 auth #!/usr/bin/env bash
#echo "ABC" >> ~/b.txt
#echo $@ >> ~/b.txt
#echo ${RSTUDIO_PASSWORD} >> ~/b.txt
#echo ${PASSWORD} >> ~/b.txt
# Confirm username is supplied
#if [[ $# -ne 1 ]]; then
# echo "Usage: auth USERNAME"
# exit 1
#fi
USERNAME="${1}"
#echo "DD" >> ~/b.txt
# Confirm password environment variable exists
if [[ -z ${RSTUDIO_PASSWORD} ]]; then
echo "The environment variable RSTUDIO_PASSWORD is not set"
exit 1
fi
#echo "EE" >> ~/b.txt
# Read in the password from user
read -s -p "Password: " PASSWORD
echo ""
if [[ ${USERNAME} == ${USER} && ${PASSWORD} == ${RSTUDIO_PASSWORD} ]]; then
echo "Successful authentication"
exit 0
else
echo "Invalid authentication"
exit 1
fi
rsession.log
通过Singularity 进入镜像正常 [root@hpc-node1 rstudio-server]# singularity shell rstudio.sif
Singularity> ls /usr/lib/rstudio-server/bin/
crash-handler-proxy crashpad_handler crashpad_http_upload postback quarto r-ldpath rpostback rserver rserver-pam rserver-url rsession rstudio-server
|
任何人有相关进展吗? |
请问问题解决了吗 |
没有 |
重新使用以下环境编译以后还是不行,报错404。 连接的url好像有问题?日志中没有报错,看上去正常。 |
通过IP:port的方式能正常使用,通过已创建应用中的连接链接类使用这种 下面是rstudio.yml的配置文件。 # 这个应用的ID
id: rstudio
# 这个应用的名字
name: RStudio
# 指定应用类型为web
type: web
# Web应用的配置
web:
# 指定反向代理类型
proxyType: relative
# 准备脚本
beforeScript: |
export PORT=$(get_port)
export PASSWORD=$(get_password 12)
export SLURM_COMPUTE_NODE_HOSTNAME=$(hostname)
export APPURI="${PROXY_BASE_PATH}/${SLURM_COMPUTE_NODE_HOSTNAME}/${PORT}/"
export USER=${USER}
export SINGULARITY_VERSION="singularity/4.2.0"
# 运行任务的脚本。可以使用准备脚本定义的变量
script: |
setup_env () {
# Additional environment which could be moved into a module
export RSTUDIO_PASSWORD=${PASSWORD}
# Change these to suit
export RSTUDIO_SERVER_IMAGE="/data/software/rstudio-server/rstudio.sif"
# 容器中rstudio的路径
export RSTUDIO_HOME=/usr/lib/rstudio-server
export RSTUDIO_BIN_PATH=${RSTUDIO_HOME}/bin
export RSTUDIO_RSERVER=${RSTUDIO_BIN_PATH}/rserver
export RSTUDIO_RSESSION=${RSTUDIO_BIN_PATH}/rsession
export RSTUDIO_AUTH="/data/software/rstudio-server/auth"
export RSESSION_WRAPPER_FILE="${PWD}/rsession.sh"
export DB_CONF_FILE="${PWD}/database.conf"
export WHICHR=/data/software/R/${r_version}/bin/R
}
setup_env
module switch ${SINGULARITY_VERSION}
(
umask 077
sed 's/^ \{2\}//' > "${RSESSION_WRAPPER_FILE}" << EOL
#!/usr/bin/env bash
# Log all output from this script
export RSESSION_LOG_FILE="${PWD}/rsession.log"
exec &>>"\${RSESSION_LOG_FILE}"
# Launch the original command
echo "Launching rsession..."
set -x
exec ${RSTUDIO_RSESSION} --r-libs-user "${R_LIBS_USER}" "\${@}"
EOL
)
chmod 700 "${RSESSION_WRAPPER_FILE}"
cd "${HOME}"
export TMPDIR="$(mktemp -d)"
mkdir -p "$TMPDIR/rstudio-server"
python -c 'from uuid import uuid4; print(uuid4())' > "$TMPDIR/rstudio-server/secure-cookie-key"
chmod 0600 "$TMPDIR/rstudio-server/secure-cookie-key"
(
umask 177
cat > "${DB_CONF_FILE}" << EOL
provider=sqlite
directory=${HOME}/.local/share/rstudio/database
EOL
)
set -x
# Launch the RStudio Server
echo "Starting up rserver..."
# RStudio Server 1.4.1103之前版本不需要--database-config-file,之后版本需要增加此配置
singularity run -B "/tmp:/tmp","/data:/data" "$RSTUDIO_SERVER_IMAGE" ${RSTUDIO_RSERVER} \
--www-port "${PORT}" \
--auth-none 1 \
--auth-pam-helper-path "${RSTUDIO_AUTH}" \
--auth-encrypt-password 0 \
--rsession-path "${RSESSION_WRAPPER_FILE}" \
--server-data-dir "${TMPDIR}" \
--server-user ${USER} \
--secure-cookie-key-file "${TMPDIR}/rstudio-server/secure-cookie-key" \
--database-config-file "${DB_CONF_FILE}" \
--rsession-which-r ${WHICHR}
echo 'Singularity as exited...'
# 如何连接应用
connect:
method: POST
path: /auth-do-sign-in
formData:
password: "{{ PASSWORD }}"
username: "{{ USER }}"
appUri: "{{ APPURI }}"
# 配置HTML表单
attributes:
- type: select
name: r_version
label: 请选择R版本
select:
- value: R-4.2.3
label: 4.2.3
- type: text
name: sbatchOptions
label: 其他sbatch参数
required: false
placeholder: "比如:--gpus gres:2 --time 10" |
可能是交互式应用的配置问题,现在是否还会出现? |
还有这个问题,一直没处理。 |
同一个平台下jupyter或者vscode能正常使用吗? |
其他应用正常,会不会是编译镜像的问题?(系统:RockyLinux 9.4) |
按文档https://icode.pku.edu.cn/SCOW/docs/deploy/config/portal/apps/apps/rstudio 配置
RStudio Server 1.4.1103及之后版本
源码方式的RStudio Server后,创建R应用报错下面是输出日志slurm-13.out
before.sh
The text was updated successfully, but these errors were encountered: