Exemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                Configuration c = new Configuration("config.xml");

                Sendmail.Send(c.developers,
                              "Build failed at Windows (x86/x64)",
                              "The build failed; please check the attached logfile for errors.",
                              c.build_log);
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine("Exception: " + ex.Message);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                config = Application["Configuration"] as Configuration;

                try
                {
                    _defaultParams = new Dictionary<string, string>();
                    string p = Request.Params.Get("days");
                    _defaultParams.Add("days", (p == null) ? config.daysback.ToString() : p);
                    p = Request.Params.Get("cat");
                    _defaultParams.Add("cat", (p == null) ? "" : p);
                    timeline = new Timeline(Server.MapPath("~"), config.datadir, config.timeline);
                    buildCategoryPanels();
                }
                catch (Exception ex)
                {
                    Label l = new Label();
                    l.Text = "Error loading dataset: " + ex.Message;
                    phMain.Controls.Add(l);
                    l = new Label();
                    l.Text = "Stacktrace: " + ex.StackTrace;
                    phMain.Controls.Add(l);
                }
            }
        }
Exemplo n.º 3
0
        public void Run(string[] args)
        {
            SubmissionWorker w = new SubmissionWorker(IntPtr.Zero, 0);
            w.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
            w.WorkerReportsProgress = true;
            w.WorkerSupportsCancellation = false;

            Configuration config;

            if (args.Count() == 1)
            {
                if (args[0] == "-h" || args[0] == "--help" || args[0] == "/?")
                {
                    Console.WriteLine("Usage: ClusterSubmit [config-file]");
                    return;
                }
                else
                    config = new Configuration(args[0]);
            }
            else
                config = new Configuration("config.xml");

            string executable = findBinary(config.z3_drop_dir, config.z3_release_dir, config.z3_exe);

            if (executable == "")
            {
                Console.WriteLine(now() + ": Z3 not found.");
                return;
            }
            else if (File.Exists("last_binary"))
            {
                FileStream lf = File.OpenRead("last_binary");
                StreamReader sr = new StreamReader(lf);
                long last = Convert.ToInt64(sr.ReadLine());
                if (last >= File.GetLastWriteTime(executable).ToFileTimeUtc())
                {
                    Console.WriteLine(now() + ": No new binary.");
                    return;
                }
                sr.Close();
                lf.Close();
            }

            bool haveBinId = false;
            int binId = 0;

            try
            {
                string bestCluster = SubmissionWorker.FindCluster(config.cluster, config.alternativeClusters);
                Console.WriteLine(now() + ": Submitting job to " + bestCluster + " with the following binary: " + executable);

                w.UploadBinary(config.db, executable, ref haveBinId, ref binId);

                string sExecutor = "";
                int jid =
                    w.SetupExperiment(config.db, config.category, config.sharedDir, config.memout, config.timeout, config.executor, config.parameters,
                                      bestCluster, config.nodegroup, config.locality, config.minResources, config.maxResources, config.username, config.priority, config.extension, config.note, ref haveBinId, ref binId, ref sExecutor);
                w.SubmitHPCJob(config.db, true, jid, config.cluster, config.nodegroup, config.priority, config.locality, config.minResources, config.maxResources, config.sharedDir, sExecutor);

                saveBinaryDate(executable);

                uint retries = 0;
                if (File.Exists(config.fuzzer_target))
                {
                retry:
                    if (File.GetLastWriteTime(executable) > File.GetLastWriteTime(config.fuzzer_target))
                    {
                        try
                        {
                            File.Copy(executable, config.fuzzer_target, true);
                        }
                        catch (Exception ex)
                        {
                            retries++;
                            if (retries < config.fuzzer_max_retries)
                                goto retry;
                            else
                                throw ex;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(now() + ": Exception caught: " + ex.Message);
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                config = Application["Configuration"] as Configuration;

                string px = null, py = null;

                if (!IsPostBack)
                {
                    Timeline tl = new Timeline(Server.MapPath("~"), config.datadir, config.timeline);

                    string penultimate = tl.Lookup(tl.RowCount - 2, "ID").ToString();
                    string latest = tl.Lookup(tl.RowCount - 1, "ID").ToString();

                    lstTagX.Items.Add(new ListItem("Latest (" + latest + ")", latest));
                    lstTagX.Items.Add(new ListItem("Penultimate (" + penultimate + ")", penultimate));
                    lstTagY.Items.Add(new ListItem("Latest (" + latest + ")", latest));
                    lstTagY.Items.Add(new ListItem("Penultimate (" + penultimate + ")", penultimate));

                    foreach (KeyValuePair<string, uint> kvp in config.tags)
                    {
                        lstTagX.Items.Add(new ListItem(kvp.Key + " (" + kvp.Value.ToString() + ")", kvp.Value.ToString()));
                        lstTagY.Items.Add(new ListItem(kvp.Key + " (" + kvp.Value.ToString() + ")", kvp.Value.ToString()));
                    }

                    px = Request.Params.Get("jobX");
                    py = Request.Params.Get("jobY");
                    Prefix = Request.Params.Get("prefix");

                    if (px == null) rbnTagX.Checked = true; else { txtIDX.Text = px; rbnIDX.Checked = true; }
                    if (py == null) rbnTagY.Checked = true; else { txtIDY.Text = py; rbnIDY.Checked = true; }

                    if (px != null)
                    {
                        if (config.tags.HasID(px))
                        {
                            rbnTagX.Checked = true;
                            lstTagX.SelectedValue = px;
                        }
                        else
                            lstTagX.SelectedValue = penultimate;
                    }
                    else
                        lstTagX.SelectedValue = penultimate;

                    if (py != null)
                    {
                        if (config.tags.HasID(py))
                        {
                            rbnTagY.Checked = true;
                            lstTagY.Items.FindByText(py.ToString());
                            lstTagY.SelectedValue = py.ToString();
                        }
                        else
                            lstTagY.SelectedValue = latest;
                    }
                    else
                        lstTagY.SelectedValue = latest;
                }

                JX = px != null ? px : rbnTagX.Checked ? lstTagX.SelectedValue : txtIDX.Text;
                JY = py != null ? py : rbnTagY.Checked ? lstTagY.SelectedValue : txtIDY.Text;

                Job jX = null, jY = null;

                try
                {
                    jX = new Job(config.datadir, (uint)Convert.ToInt32(JX), true);
                    jY = new Job(config.datadir, (uint)Convert.ToInt32(JY), true);
                }
                catch (Exception)
                {
                }

                txtIDX.Text = JX;
                txtIDY.Text = JY;

                cmp = new Comparison(jX, jY, Prefix.Replace('|', '\\'), config.tags);

                phPre.Controls.Add(buildHeader("CHART_PRE", ""));
                phChart.Controls.Add(buildChart());
                phHisto.Controls.Add(buildHistogramm());
                phMain.Controls.Add(buildTabPanels());
                //phMain.Controls.Add(buildFooter());
            }
            catch (Exception ex)
            {
                Label l = new Label();
                l.Text = "Error loading dataset: " + ex.Message;
                phMain.Controls.Add(l);
                l = new Label();
                l.Text = "Stacktrace: " + ex.StackTrace;
                phMain.Controls.Add(l);
            }
        }