Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ictsc/ictsc-score-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: janog-netcon/netcon-score-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing with 3,513 additions and 550 deletions.
  1. +1 −1 .circleci/config.yml
  2. +6 −1 .env.sample
  3. +129 −0 .github/workflows/build-and-push.yaml
  4. +3 −0 .gitignore
  5. +0 −19 .yamllint
  6. +2 −6 README.md
  7. +1 −1 api/.ruby-version
  8. +2 −2 api/Dockerfile
  9. +14 −7 api/Gemfile
  10. +269 −208 api/Gemfile.lock
  11. +13 −11 api/app/controllers/graphql_controller.rb
  12. +44 −1 api/app/controllers/sessions_controller.rb
  13. +5 −0 api/app/errors/available_problem_environment_not_exists.rb
  14. +5 −0 api/app/errors/problem_environment_already_assigned.rb
  15. +5 −0 api/app/errors/problem_environment_not_ready.rb
  16. +7 −3 api/app/graphql/acl.rb
  17. +7 −0 api/app/graphql/api_schema.rb
  18. +1 −1 api/app/graphql/association_loader.rb
  19. +60 −0 api/app/graphql/mutations/abandon_problem_environment.rb
  20. +76 −0 api/app/graphql/mutations/acquire_problem_environment.rb
  21. +8 −3 api/app/graphql/mutations/add_answer.rb
  22. +2 −0 api/app/graphql/mutations/apply_problem.rb
  23. +1 −1 api/app/graphql/mutations/apply_problem_environment.rb
  24. +47 −0 api/app/graphql/mutations/apply_score.rb
  25. +8 −8 api/app/graphql/notification.rb
  26. +1 −1 api/app/graphql/types/base_object.rb
  27. +2 −0 api/app/graphql/types/contest_info_type.rb
  28. +27 −25 api/app/graphql/types/mutation_type.rb
  29. +15 −15 api/app/graphql/types/problem_environment_type.rb
  30. +3 −0 api/app/graphql/types/query_type.rb
  31. +13 −5 api/app/jobs/slack_notifier_job.rb
  32. +3 −13 api/app/models/answer.rb
  33. +28 −10 api/app/models/concerns/readable.rb
  34. +7 −0 api/app/models/config.rb
  35. +2 −2 api/app/models/problem_body.rb
  36. +1 −0 api/app/models/score.rb
  37. +1 −1 api/app/models/team.rb
  38. +2 −2 api/bin/rails
  39. +2 −2 api/bin/rake
  40. +0 −5 api/bin/rspec
  41. +1 −1 api/bin/setup
  42. +0 −17 api/bin/spring
  43. +1 −0 api/config.ru
  44. +3 −1 api/config/application.rb
  45. +31 −5 api/config/database.yml
  46. +0 −11 api/config/initializers/bugsnag.rb
  47. +0 −2 api/config/initializers/bullet.rb
  48. +3 −1 api/config/initializers/filter_parameter_logging.rb
  49. +12 −0 api/config/initializers/sentry.rb
  50. +3 −0 api/config/initializers/slack.rb
  51. +6 −0 api/config/routes.rb
  52. +5 −0 api/db/migrate/20201125124948_add_columns_to_problem_environment.rb
  53. +6 −0 api/db/migrate/20201125190551_modify_unique_index_column_of_problem_environment.rb
  54. +5 −0 api/db/migrate/20201223100444_add_external_status_to_problem_environment.rb
  55. +5 −0 api/db/migrate/20201228151612_change_status_of_problem_environments_to_nullable.rb
  56. +6 −0 api/db/migrate/20210115135749_add_project_and_zone_to_project_environment.rb
  57. +8 −0 api/db/migrate/20230111122643_remove_unused_columns_from_problem_environments.rb
  58. +5 −5 api/db/schema.rb
  59. +26 −13 api/db/seeds/development.rb
  60. +4 −0 api/db/seeds/production.rb
  61. +5 −3 api/spec/factories/problem_environment.rb
  62. +2 −0 api/spec/support/config_helpers.rb
  63. +80 −15 docker-compose.yml
  64. +25 −0 exporter/Dockerfile
  65. +194 −0 exporter/collector.go
  66. +58 −0 exporter/db.go
  67. +45 −0 exporter/go.mod
  68. +89 −0 exporter/go.sum
  69. +125 −0 exporter/main.go
  70. +48 −0 exporter/models.go
  71. +62 −0 exporter/server.go
  72. +12 −0 prometheus/prometheus.yml
  73. +13 −0 renovate.json
  74. +8 −2 ui/Dockerfile
  75. +28 −0 ui/Dockerfile.dev
  76. BIN ui/assets/img/JANOG55_ase_net.png
  77. BIN ui/assets/img/JANOG55_exfo.png
  78. BIN ui/assets/img/JANOG55_harada.jpg
  79. BIN ui/assets/img/JANOG55_keysight.png
  80. BIN ui/assets/img/JANOG55_logo.png
  81. BIN ui/assets/img/JANOG55_seikoh_giken.png
  82. BIN ui/assets/img/JANOG55_sticklers.jpg
  83. BIN ui/assets/img/ictsc-logo-white.eps
  84. +0 −1 ui/assets/img/ictsc-logo-white.svg
  85. +47 −0 ui/components/guide/SwitchLanguageButtons.vue
  86. +1 −1 ui/components/issues/IssueCard.vue
  87. +1 −0 ui/components/misc/ConfigModal.vue
  88. +4 −4 ui/components/misc/EnvironmentModal.vue
  89. +66 −11 ui/components/misc/Navigation.vue
  90. +2 −2 ui/components/misc/NavigationLink.vue
  91. +1 −1 ui/components/misc/ProblemModal.vue
  92. +4 −4 ui/components/misc/TeamModal.vue
  93. +3 −2 ui/components/problems/Attention.vue
  94. +2 −2 ui/components/problems/Flow.vue
  95. +1 −1 ui/components/problems/FlowItem.vue
  96. +1 −0 ui/components/problems/ProblemCard.vue
  97. +13 −22 ui/components/problems/ProblemCardPlayer.vue
  98. +11 −0 ui/components/problems/id/DetailsPanel.vue
  99. +18 −11 ui/components/problems/id/EnvironmentTable.vue
  100. +1 −1 ui/components/problems/id/GradingForm.vue
  101. +1 −1 ui/components/problems/id/InfoChipsArea.vue
  102. +2 −2 ui/components/problems/id/IssuePanel.vue
  103. +196 −0 ui/components/problems/id/ProblemEnvironmentOperation.vue
  104. +2 −2 ui/components/settings/DeleteComponentArea.vue
  105. +2 −2 ui/components/settings/SessionTable.vue
  106. +2 −2 ui/components/summary/ReportCardTable.vue
  107. +1 −1 ui/layouts/default.vue
  108. +54 −0 ui/nginx.conf
  109. +0 −1 ui/node_modules
  110. +6 −8 ui/nuxt.config.js
  111. +33 −1 ui/orm/Mutations.js
  112. +1 −1 ui/orm/Problem.js
  113. +15 −3 ui/orm/ProblemEnvironment.js
  114. +15 −1 ui/orm/Queries.js
  115. +3 −2 ui/orm/Team.js
  116. +1 −1 ui/package.json
  117. +2 −2 ui/pages/answers.vue
  118. +46 −9 ui/pages/guide.vue
  119. +1 −1 ui/pages/issues.vue
  120. +12 −2 ui/pages/login.vue
  121. +4 −4 ui/pages/problems/_id.vue
  122. +1 −0 ui/pages/problems/index.vue
  123. +2 −2 ui/pages/settings.vue
  124. +134 −0 ui/pages/signup.vue
  125. +2 −2 ui/pages/teams.vue
  126. +1 −1 ui/plugins/elvis.js
  127. +1 −1 ui/plugins/moment-update-locale.js
  128. +6 −0 ui/store/contestInfo.js
  129. +25 −0 vmdb-api/Dockerfile
  130. +250 −0 vmdb-api/controller.go
  131. +35 −0 vmdb-api/go.mod
  132. +58 −0 vmdb-api/go.sum
  133. +22 −0 vmdb-api/helpers.go
  134. +110 −0 vmdb-api/main.go
  135. +53 −0 vmdb-api/models.go
  136. +317 −0 vmdb-api/output.json
  137. +112 −0 vmdb-api/repository.go
  138. +62 −0 vmdb-api/server.go
  139. +0 −5 yamllint/Dockerfile
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ jobs:
- image: circleci/postgres:11.3-alpine-postgis-ram

# circleci/redisにしても早くならなかった
- image: redis:5.0.4-alpine
- image: redis:7.4.1-alpine

steps:
# コンテナ内のworking_directoryに対象のブランチをコピーする
7 changes: 6 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TZ=Asia/Tokyo
RAILS_ENV=development
NODE_ENV=development
POSTGRES_DB=development

API_STAFF_PASSWORD=staff
API_SESSION_EXPIRE_MINUTES=10080
@@ -10,7 +11,9 @@ API_SESSION_EXPIRE_MINUTES=10080
# RAILS_LOG_TO_STDOUT=1

# SLACK_WEBHOOK_URL=https://hooks.slack.com/services/HOGEHOGE
# BUGSNAG_API_KEY=
# SLACK_ANSWER_CHANNEL=notification-score-server-answer
# SLACK_QUESTION_CHANNEL=notification-score-server-question
# SCORE_SERVER_DOMAIN=https://netcon.janog.gr.jp

POSTGRES_HOST=db
POSTGRES_USER=postgres
@@ -37,3 +40,5 @@ PLASMA_SUBSCRIBER_REDIS_OVER_MAX_RETRY_BEHAVIOR=alive
PLASMA_SUBSCRIBER_REDIS_MAX_RETRY=5
PLASMA_SUBSCRIBER_REDIS_TIMEOUT=1s
PLASMA_SUBSCRIBER_REDIS_RETRY_INTERBAL=5s

GATEWAY_URL="http://172.18.0.200:8082"
129 changes: 129 additions & 0 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build and Push image to gcr.io
on:
push:
branches:
- master
jobs:
build-and-push-to-gcr-api:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/907031882243/locations/global/workloadIdentityPools/github/providers/github"
service_account: "github-actions-score-server-ci@networkcontest.iam.gserviceaccount.com"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Use gcloud CLI
run: gcloud info
- name: Export credentials for Docker
run: gcloud auth configure-docker asia-northeast1-docker.pkg.dev -q
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push API container
uses: docker/build-push-action@v3
with:
context: ./api
file: ./api/Dockerfile
push: true
tags: |
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-api:latest
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-api:master
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-api:commit-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

build-and-push-to-gcr-ui:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/907031882243/locations/global/workloadIdentityPools/github/providers/github"
service_account: "github-actions-score-server-ci@networkcontest.iam.gserviceaccount.com"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Use gcloud CLI
run: gcloud info
- name: Export credentials for Docker
run: gcloud auth configure-docker asia-northeast1-docker.pkg.dev -q
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push UI container
uses: docker/build-push-action@v3
with:
context: ./ui
file: ./ui/Dockerfile
push: true
tags: |
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-ui:latest
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-ui:master
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-ui:commit-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

build-and-push-to-gcr-vmdb-api:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/907031882243/locations/global/workloadIdentityPools/github/providers/github"
service_account: "github-actions-score-server-ci@networkcontest.iam.gserviceaccount.com"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Use gcloud CLI
run: gcloud info
- name: Export credentials for Docker
run: gcloud auth configure-docker asia-northeast1-docker.pkg.dev -q
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push vmdb-api container
uses: docker/build-push-action@v3
with:
context: ./vmdb-api
file: ./vmdb-api/Dockerfile
push: true
tags: |
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-vmdb-api:latest
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-vmdb-api:master
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-vmdb-api:commit-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

build-and-push-to-gcr-exporter:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/907031882243/locations/global/workloadIdentityPools/github/providers/github"
service_account: "github-actions-score-server-ci@networkcontest.iam.gserviceaccount.com"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Use gcloud CLI
run: gcloud info
- name: Export credentials for Docker
run: gcloud auth configure-docker asia-northeast1-docker.pkg.dev -q
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push exporter container
uses: docker/build-push-action@v3
with:
context: ./exporter
file: ./exporter/Dockerfile
push: true
tags: |
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-exporter:latest
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-exporter:master
asia-northeast1-docker.pkg.dev/networkcontest/janog55/network-score-server-exporter:commit-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -150,3 +150,6 @@ __pycache__/
var.yml
deploy_ready_output
env.yaml

vm-management-service-conf-d/*
vm-management-service-log/*
19 changes: 0 additions & 19 deletions .yamllint

This file was deleted.

8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
ICTSC Score Server
NETCON Score Server
---

[![CircleCI](https://circleci.com/gh/ictsc/ictsc-score-server/tree/develop.svg?style=svg)](https://circleci.com/gh/ictsc/ictsc-score-server)
![Docker Automated build](https://img.shields.io/docker/automated/upluse10/ictsc-score-server.svg)

The contest site for [ICTSC](http://icttoracon.net/) (ICT Trouble Shooting Contest).
The contest site for [JANOG55 NETCON](https://www.janog.gr.jp/meeting/janog55).

It's called also *score server*. The main feature of this is to propose problem and marking.

@@ -39,4 +36,3 @@ API and SPA
## Usage and How to Contribute

See [Wiki](https://github.com/ictsc/ictsc-score-server/wiki)

2 changes: 1 addition & 1 deletion api/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.6.3
3.2.2
4 changes: 2 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ruby:2.7.0-alpine3.11
FROM ruby:3.2.2-alpine

LABEL maintainer "ICTSC"
LABEL maintainer "JANOG NETCON"

ENV LANG ja_JP.UTF-8
ENV LC_ALL ja_JP.UTF-8
21 changes: 14 additions & 7 deletions api/Gemfile
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@
source 'https://rubygems.org'
git_source(:github) {|repo| "https://github.com/#{repo}.git" }

ruby '2.7.0'
ruby '3.2.2'

gem 'rails', '~> 6.0.0'
gem 'rails', '~> 6.1'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 4.3'
gem 'puma', '~> 5.0'
gem 'colorize'
gem 'oj'

@@ -38,15 +38,21 @@ gem 'activerecord-import'
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
gem 'bootsnap', '>= 1.4.4', require: false

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem 'rack-cors'

gem 'tzinfo-data'

gem 'slack-notifier'
gem 'bugsnag'
gem 'rest-client'

gem 'sentry-ruby'
gem 'sentry-rails'

# 状況表示や成績計算のために使用
gem 'matrix'

# プロダクションに必須ではないがあると便利
gem 'factory_bot_rails'
@@ -63,10 +69,11 @@ group :development, :test do
end

group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'sprockets', '~> 3.7.2'
gem 'graphiql-rails'
end

group :test do
Loading