@@ -40,18 +40,6 @@ using Documenter
4040using Literate
4141
4242using UUIDs
43- s = Server (name= gethostname (), port= 8080 , domain = " localhost" , scheduler = Servers. Bash (), uuid = string (uuid4 ()), julia_exec= Sys. BINDIR * " /julia" )
44- if ! exists (s)
45- Servers. initialize_config_dir (s)
46- save (s)
47- else
48- s = Servers. local_server ()
49- end
50- if ! isalive (s)
51- @info " Starting server here"
52- Servers. initialize_config_dir (s)
53- @async DFC. Resource. run ()
54- end
5543
5644# Collect examples from the example index (src/index.md)
5745# The chosen examples are taken from the examples/ folder to be processed by Literate
@@ -78,6 +66,43 @@ for (dir, directories, files) in walkdir(SRCPATH)
7866 end
7967end
8068
69+ using RemoteHPC: configure_local, julia_main
70+ import RemoteHPC: config_path
71+ if ! isempty (literate_files)
72+
73+ tconfdir = tempname ()
74+ if ispath (tconfdir)
75+ rm (tconfdir; recursive = true )
76+ end
77+ config_path (p... ) = joinpath (tconfdir, p... )
78+
79+ paths = [" jobs" ,
80+ " logs/jobs" ,
81+ " logs/runtimes" ,
82+ " storage/servers" ,
83+ " storage/execs" ,
84+ " storage/environments" ]
85+
86+ for p in paths
87+ mkpath (config_path (p))
88+ end
89+
90+ redirect_stdin (devnull ) do
91+ redirect_stderr (devnull ) do
92+ redirect_stdout (devnull ) do
93+ configure_local (; interactive = false )
94+ return t = @async julia_main ()
95+ end
96+ end
97+ end
98+
99+ while ! isalive (local_server ())
100+ sleep (0.1 )
101+ end
102+ end
103+
104+
105+
81106# Run Literate on them all
82107for file in literate_files
83108 # preprocess = file.example ? add_badges : identity
0 commit comments