SITCON
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
Online Judge 開發甘苦談 - 蕭于傑, 莊博傑 === <blockquote> 在各大學的資訊基礎課程中,透過 OJ(Online Judge)來自動化批改作業或進行考試已經屢見不鮮。然而一群師大資工的新生在入學後發現:為什麼我們系上都沒有在用 OJ 呢? 既然沒有那就自己創造!本議程將會說明六個同學如何在軟體工程課程中開發出一個堪用的 OJ,並在一年內將它轉變爲系上第一個以開發軟體為主軸的服務學習課程,以及其中的心路歷程。 ## 目標聽眾 想知道 OJ 實作細節或是想在學校推動改變的學生 ## 先備知識 無 </blockquote> ###### tags: `SITCON 2021 共筆` `SITCON 2021` `2021` `共筆` `R1` {%hackmd 8guaVQ0CRbaeUldFwc_8Ow %} > 請從這裡開始 ## 簡報連接 [Google Slides](https://docs.google.com/presentation/d/195WTVf8WcMcHaMDQxayDvvEn_W7Xn2t7P-BIRJgoxtA/edit?usp=sharing) ## 動機 * 師大的程式設計課作業是由助教手動批改 * 程式能做到為什麼需要手動 ## 軟體工程:NOJ 開發 ### 軟體工程 * 一組約 18 人 ### 為何自幹 * 教學用途 * 現存的 OJ 主要是競賽用途 * 特殊需求 * makefile * 檔案處理 * 爬蟲 ### 沙盒需求 - 執行使用者上傳的程式 - 不要影響其他人的程式 - 控制 CPU,Mem 用量 ### 沙盒安全性 #### Compile time - /dev/random 檔案 - 經常阻塞的檔案 - 阻塞編譯器 #### 執行時期 - 非法 syscall - fork bomb - network - 當跳板 - 檔案存取 - 答案被看光光 ### 其他 OJ #### Zerojudge ```c= #include <stdio.h> int main() { system("ls"); return 0; } ``` - 失敗了,ZJ 做簡單的處理禁止 `system` 函數 - 使用 `syscall` function 成功繞過 - libc wrapper of syscall #### UVa - 網路沒關 - 往外連送測資 #### 架構 - setrlimit - 限制資源用量 - docker - 隔離 file system - 抓一些 seccomp 的漏網之魚 - 隔離網路存取 - seccomp - 控制危險的 syscall - 使用「白名單模式」 # ~~全師大最大的~~ OJ 上線拉 ## Judge Error - 讀使用者輸入的時候沒有考慮 decoding 失敗的情況 - 輸出非 UTF-8 - 注意 decode error handling ## Log 爆炸 - 把硬碟塞爆 - 要記得做 log rotate - 還要記得做 monitor ## Submission query 很慢 - 需要 2 分鐘 ???!!!! > 想不到吧 - 做 DB index - 做 cache、建 index # pyShare ## 需求 - 老師上課要做資料分析 - 需要上傳檔案(資料集)至題目內 - 示範創作 - 注重分享功能 - 沒有絕對的對錯 - 讓同儕觀察其他人的程式 - 輸出圖表 - 統計活動紀錄 ## 為何會開第二個專案 - 注重分享功能、非自動化評分 - 再造一個輪子 # 服務學習 ## 師大資工的服務學習選項 - 資工營隊 - (社團)返鄉服務隊 ## 他校的服務學習 - 營隊 - 掃地<!--(??????) 有些學校是這樣,如果我當初查資料沒搞錯的話 好合理www--> - 台大 NASA - 維運學校網路系統 - 清大 - 錄演算法影片 - 做資料結構的投影片 ## 開設原始碼維護服務學習 - 需要教授幫忙開課 - 擔心服務學習會不會數年後就死去 - 目前 - 學分認定 - 跟以往的資工營、返服差別很大,需要重新設計認定的方式 - 帶人困難 - 團隊經營 - 技術能力不足 <!--所以目前有服務學習ㄇ--> <!-- 有開一學期了! --> ## 成果 - 本學期 - ip 檢查 - 避免他人從非電腦教室檢視考試題目 - copycat - 抄襲檢查 - refactor - 未來 - nsjail - 檔案處理 # Credit - 紀博文老師 - 幫忙開設這個服務學習 - 葉梅珍老師、王弘倫老師 - 在系統不成熟時將 NOJ 納入課程 - 台大 NASA # Q/A 時間 ## 如果 Judge 被打怎麼辦? - 沙盒下功夫 - 需要打穿 seccomp - 再需要打 docker - 難度大 - 後端被打穿 - 目前還沒遇到 ## 授課老師對 Judge 公正性會不會有疑慮? - 目前沒有疑慮 - 可以翻閱 Source Code ## 經費來源? - 一開始幫教授接案子 - 自掏腰包 - 系上(or 系上老師)主要贊助機器借我們使用(之前長期使用的三台電腦直接購買大概要十二萬吧) - 未來希望可以跟系上爭取經費 ## 支持不同程式語言 - C++ - C - Python - 未來 *文言* 吧 ## 能否判斷程式執行效能 - 看執行時間 - 直觀可測量 - 可實踐 - 演算法可能有各種方法但目前不可行 <!-- 我答一下文字回復好了 嗚嗚嗚謝謝--> ## 一般會線上測試嗎? 還是說離線寫完再上傳平台? 我推測這邊是問說同學這邊的情況?以前上程設是遇過不少同學丟會拿到 Compile Error 的程式碼上來啦...我也很好奇他們有沒有測試過。但是上課時都會鼓勵大家先在本機測試。 ## 你們開發團隊有幾個人 - 大二修軟體工程的時候我們這組約 15 人吧 - 修完之後剩六個人維護 - 服務學習的時候總共..19 人? ## 要怎麼加入服務學習 以這學期的規劃來說,師大學期開始時會有個介紹學系的活動,我們會在那時候上去宣傳,到時候會公布辦法。 > 我問一下能不能先公開,因為我們也還在討論 > [name=bogay] > Hi 我是 110 學年度該課程的負責人,加入的辦法我們會在月底公布於 [FB](https://www.facebook.com/noj.tw)。 > [name=TzuWei] <!--謝謝回答!--> ## 被大量灌 TLE 程式的話怎麼辦 - 沙盒那邊還有設置 queue 的大小限制,所以若是 judge queue 滿了就會拒收,並且也是有設定最高的可同時執行 submission 數量限制。 - 另外也有做 rate limit 與 quote 的設定可以開啟,在有需要的時候至少可以避免端時間大量繳交 submission。 - 不過這方面也是有可以優化的設計 - 像是依照使用者的最近繳交時間去設定 submission judge 的優先度,來取代現有的依照時間壓進 queue 的設計 - 還有在實際發送 submission 之前先確定沙盒的狀態,可以避免掉一些額外的封包傳送 - 當然以上都還沒做QQ ## 執行程式有記憶體限制嗎? 有,可以動態設定每個 task 的限制。 ## 請問整個 judge 從預先計畫到系統穩定花了多久時間開發 :O TL;DR:其實現在也不穩定啦... > 以下時間軸以講者觀點描述 - 最一開始我們是在大一就有模糊的構想 - 因為修程設很痛苦...想說我們幫系上用一個出來 - 大一暑假的時候先做了個 OAO OJ 練練手 - 想當然耳那東西不能用 - 大二修了軟體工程 - 在一個學期中把 NOJ 搞出來了 - 學期末葉老師說可以在演算法用 - 寒假趕快趕工,補一些可能必要的 feature - 大二下演算法成功的用了一學期 - 人數約 50 還是 70 人吧 - 大三上聯絡到程設老師願意使用 - 這堂大約 110 人左右 - 大三下有程設與演算法使用

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully