Skip to content

Commit dc2474c

Browse files
committed
Merge remote-tracking branch 'origin/dev' into config
2 parents 495e996 + e21e254 commit dc2474c

File tree

54 files changed

+155
-4375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+155
-4375
lines changed

.drone.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ steps:
4343
image: appleboy/drone-ssh
4444
failure: ignore
4545
settings:
46-
host: app.legacy.kern.ai
46+
host: app.dev.kern.ai
4747
username:
48-
from_secret: ssh_user
48+
from_secret: dev_cognition_ssh_user
4949
key:
50-
from_secret: ssh_key
51-
ssh_passphrase:
52-
from_secret: ssh_passphrase
50+
from_secret: dev_cognition_ssh_key
5351
script:
5452
- /bin/sh ./trigger_dev_deployment.sh
5553

.github/workflows/dc_deploy.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'DC: Prepare Deployment' # rename
2+
3+
on:
4+
# workflow_dispatch:
5+
release:
6+
types: [prereleased]
7+
pull_request:
8+
branches:
9+
- dev
10+
types: [closed]
11+
12+
# Special permissions required for OIDC authentication
13+
permissions:
14+
id-token: write
15+
contents: read
16+
actions: read
17+
18+
jobs:
19+
call-dc-release:
20+
uses: code-kern-ai/cicd-deployment-scripts/.github/workflows/dc_release.yml@dev
21+
if: github.event_name == 'pull_request' && github.event.pull_request.merged || github.event_name == 'release'
22+
secrets: inherit

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM kernai/refinery-parent-images:v1.19.0-next
1+
FROM kernai/refinery-parent-images:v1.20.0-next
22

33
WORKDIR /app
44
COPY package*.json /app/

dev.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM kernai/refinery-parent-images:v1.19.0-next
1+
FROM kernai/refinery-parent-images:v1.20.0-next
22

33
WORKDIR /app
44

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"@types/react": "^18.3.3",
2323
"@types/react-dom": "^18.3.0",
2424
"autoprefixer": "^10.4.19",
25-
"aws-sdk": "^2.1653.0",
2625
"chart.js": "^4.4.3",
2726
"clsx": "^1.2.1",
2827
"d3": "^7.8.5",
@@ -42,7 +41,10 @@
4241
"react-router-dom": "^6.10.0",
4342
"rxjs": "^7.8.1",
4443
"tailwindcss": "^3.4.4",
45-
"typescript": "^5.1.3"
44+
"typescript": "^5.1.3",
45+
"@aws-sdk/client-s3": "^3.685.0",
46+
"i18next": "^23.11.5",
47+
"lodash": "^4.17.21"
4648
},
4749
"devDependencies": {
4850
"autoprefixer": "^10.4.15",

src/components/projects/projectId/attributes/attributeId/AttributeCalculations.tsx

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { TOOLTIPS_DICT } from "@/src/util/tooltip-constants";
2424
import { selectAllUsers, selectOrganizationId, setComments } from "@/src/reduxStore/states/general";
2525
import { CommentDataManager } from "@/src/util/classes/comments";
2626
import { CommentType } from "@/src/types/shared/comments";
27-
import BricksIntegrator from "@/src/components/shared/bricks-integrator/BricksIntegrator";
2827
import { AttributeCodeLookup } from "@/src/util/classes/attribute-calculation";
2928
import KernDropdown from "@/submodules/react-components/components/KernDropdown";
3029
import { useWebsocket } from "@/submodules/react-components/hooks/web-socket/useWebsocket";
@@ -35,6 +34,7 @@ import { getLookupListsByProjectId } from "@/src/services/base/lookup-lists";
3534
import { getLabelingTasksByProjectId, getProjectTokenization } from "@/src/services/base/project";
3635
import { getAttributeByAttributeId, updateAttribute } from "@/src/services/base/project-setting";
3736
import { Application, CurrentPage } from "@/submodules/react-components/hooks/web-socket/constants";
37+
import { VisitBricksButton } from "@/src/components/shared/bricks/VisitBricksButton";
3838

3939
const EDITOR_OPTIONS = { theme: 'vs-light', language: 'python', readOnly: false };
4040

@@ -53,18 +53,13 @@ export default function AttributeCalculation() {
5353
const [isNameOpen, setIsNameOpen] = useState(false);
5454
const [duplicateNameExists, setDuplicateNameExists] = useState(false);
5555
const [tooltipsArray, setTooltipsArray] = useState<string[]>([]);
56-
const [isInitial, setIsInitial] = useState(null); //null as add state to differentiate between initial, not and unchecked
5756
const [editorOptions, setEditorOptions] = useState(EDITOR_OPTIONS);
5857
const [tokenizationProgress, setTokenizationProgress] = useState(0);
5958
const [editorValue, setEditorValue] = useState('');
6059
const [attributeName, setAttributeName] = useState('');
6160
const [checkUnsavedChanges, setCheckUnsavedChanges] = useState(false);
6261
const [enableRunButton, setEnableButton] = useState(false);
6362

64-
useEffect(() => {
65-
if (!currentAttribute) return;
66-
if (isInitial == null) setIsInitial(AttributeCodeLookup.isCodeStillTemplate(currentAttribute.sourceCode, currentAttribute.dataType))
67-
}, [currentAttribute]);
6863

6964
useEffect(() => {
7065
if (!projectId) return;
@@ -202,9 +197,6 @@ export default function AttributeCalculation() {
202197
}, attributeNew.dataType);
203198
}
204199

205-
function openBricksIntegrator() {
206-
document.getElementById('bricks-integrator-open-button').click();
207-
}
208200

209201
function onScrollEvent(event: any) {
210202
if (!(event.target instanceof HTMLElement)) return;
@@ -233,13 +225,6 @@ export default function AttributeCalculation() {
233225
});
234226
}
235227

236-
function updateNameAndCodeBricksIntegrator(code: string) {
237-
setEditorValue(code);
238-
const regMatch: any = getPythonFunctionRegExMatch(code);
239-
updateSourceCode(code, regMatch[2]);
240-
setIsInitial(false);
241-
}
242-
243228
function refetchLabelingTasksAndProcess() {
244229
getLabelingTasksByProjectId(projectId, (res) => {
245230
const labelingTasks = postProcessLabelingTasks(res['data']['projectByProjectId']['labelingTasks']['edges']);
@@ -368,13 +353,7 @@ export default function AttributeCalculation() {
368353
<div className="flex flex-row items-center justify-between my-3">
369354
<div className="text-sm leading-5 font-medium text-gray-700 inline-block mr-2">Editor</div>
370355
<div className="flex flex-row flex-nowrap">
371-
<BricksIntegrator
372-
moduleTypeFilter="generator,classifier" functionType="Attribute"
373-
nameLookups={attributes.map(a => a.name)}
374-
preparedCode={(code: string) => {
375-
if (currentAttribute.state == AttributeState.USABLE) return;
376-
updateNameAndCodeBricksIntegrator(code);
377-
}} />
356+
<VisitBricksButton urlExtension="generators" tooltipPlacement="left" size="small" />
378357
<Tooltip content={TOOLTIPS_DICT.ATTRIBUTE_CALCULATION.AVAILABLE_LIBRARIES} placement="bottom" color="invert">
379358
<a href="https://github.com/code-kern-ai/refinery-ac-exec-env/blob/dev/requirements.txt"
380359
target="_blank"
@@ -386,19 +365,6 @@ export default function AttributeCalculation() {
386365
</div>
387366

388367
<div className="border mt-1 relative">
389-
{isInitial && <div
390-
className="absolute top-0 bottom-0 left-0 right-0 bg-gray-200 flex items-center justify-center z-10" style={{ opacity: '0.9' }}>
391-
<div className="flex flex-col gap-2">
392-
<button onClick={openBricksIntegrator}
393-
className="bg-white text-gray-900 text font-semibold px-4 py-2 rounded-md border border-gray-300 hover:bg-gray-50 focus:outline-none">
394-
Search in bricks
395-
</button>
396-
<button onClick={() => setIsInitial(false)}
397-
className="bg-white text-gray-900 text font-semibold px-4 py-2 rounded-md border border-gray-300 hover:bg-gray-50 focus:outline-none">
398-
Start from scratch
399-
</button>
400-
</div>
401-
</div>}
402368
<Editor
403369
height="400px"
404370
defaultLanguage={'python'}

src/components/projects/projectId/heuristics/HeuristicsOverview.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import AddActiveLeanerModal from "./modals/AddActiveLearnerModal";
1414
import { postProcessingEmbeddings } from "@/src/util/components/projects/projectId/settings/embeddings-helper";
1515
import { CommentType } from "@/src/types/shared/comments";
1616
import { CommentDataManager } from "@/src/util/classes/comments";
17-
import { selectAllUsers, selectOrganizationId, setBricksIntegrator, setComments } from "@/src/reduxStore/states/general";
18-
import { getEmptyBricksIntegratorConfig } from "@/src/util/shared/bricks-integrator-helper";
17+
import { selectAllUsers, selectOrganizationId, setComments } from "@/src/reduxStore/states/general";
1918
import { useWebsocket } from "@/submodules/react-components/hooks/web-socket/useWebsocket";
2019
import { getAllComments } from "@/src/services/base/comment";
2120
import { getAttributes } from "@/src/services/base/attribute";
@@ -48,7 +47,6 @@ export function HeuristicsOverview() {
4847
dispatch(setAllAttributes(res.data['attributesByProjectId']));
4948
});
5049
}
51-
dispatch(setBricksIntegrator(getEmptyBricksIntegratorConfig()));
5250
}, [projectId]);
5351

5452
useEffect(() => {

src/components/projects/projectId/heuristics/heuristicId/active-learning/ActiveLearning.tsx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ import HeuristicStatistics from "../shared/HeuristicStatistics";
2121
import DangerZone from "@/src/components/shared/danger-zone/DangerZone";
2222
import { DangerZoneEnum } from "@/src/types/shared/danger-zone";
2323
import { getPythonClassName, getPythonClassRegExMatch } from "@/submodules/javascript-functions/python-functions-parser";
24-
import { selectAllUsers, setBricksIntegrator, setLabelsBricksIntegrator, setComments, selectOrganizationId } from "@/src/reduxStore/states/general";
24+
import { selectAllUsers, setComments, selectOrganizationId } from "@/src/reduxStore/states/general";
2525
import { CommentType } from "@/src/types/shared/comments";
2626
import { CommentDataManager } from "@/src/util/classes/comments";
27-
import BricksIntegrator from "@/src/components/shared/bricks-integrator/BricksIntegrator";
2827
import { InformationSourceCodeLookup, InformationSourceExamples } from "@/src/util/classes/heuristics";
2928
import { getInformationSourceTemplate } from "@/src/util/components/projects/projectId/heuristics/heuristics-helper";
3029
import KernDropdown from "@/submodules/react-components/components/KernDropdown";
@@ -35,6 +34,7 @@ import { getLabelingTasksByProjectId } from "@/src/services/base/project";
3534
import { getHeuristicByHeuristicId, getPayloadByPayloadId, updateHeuristicPost } from "@/src/services/base/heuristic";
3635
import { getEmbeddings } from "@/src/services/base/embedding";
3736
import { Application, CurrentPage } from "@/submodules/react-components/hooks/web-socket/constants";
37+
import { VisitBricksButton } from "@/src/components/shared/bricks/VisitBricksButton";
3838

3939
export default function ActiveLearning() {
4040
const dispatch = useDispatch();
@@ -49,7 +49,6 @@ export default function ActiveLearning() {
4949
const allUsers = useSelector(selectAllUsers);
5050

5151
const [lastTaskLogs, setLastTaskLogs] = useState<string[]>([]);
52-
const [isInitialAL, setIsInitialAL] = useState<boolean>(null); //null as add state to differentiate between initial, not and unchecked
5352
const [checkUnsavedChanges, setCheckUnsavedChanges] = useState(false);
5453

5554
useEffect(() => {
@@ -71,8 +70,6 @@ export default function ActiveLearning() {
7170
if (!embeddings) return;
7271
dispatch(setFilteredEmbeddings(embeddings.filter(e => embeddingRelevant(e, attributes, labelingTasks, currentHeuristic.labelingTaskId))));
7372
refetchTaskByTaskIdAndProcess();
74-
if (isInitialAL == null) setIsInitialAL(InformationSourceCodeLookup.isCodeStillTemplate(currentHeuristic.sourceCode.replace(embeddingsFiltered[0]?.name, '@@EMBEDDING@@')) != null)
75-
7673
}, [currentHeuristic]);
7774

7875
useEffect(() => {
@@ -255,23 +252,11 @@ export default function ActiveLearning() {
255252
)}
256253
</div>
257254
<div className="flex flex-row flex-nowrap items-center ml-auto">
258-
<BricksIntegrator
259-
moduleTypeFilter={currentHeuristic.labelingTaskType == 'MULTICLASS_CLASSIFICATION' ? 'classifier' : 'extractor'}
260-
executionTypeFilter="activeLearner"
261-
functionType="Heuristic"
262-
labelingTaskId={currentHeuristic.labelingTaskId}
263-
preparedCode={(code: string) => {
264-
updateSourceCode(code);
265-
setIsInitialAL(false);
266-
}}
267-
newTaskId={(value) => setValueToLabelingTask(value)}
268-
/>
255+
<VisitBricksButton tooltipPlacement="left" size="small" />
269256
</div>
270257
</div>
271258
<HeuristicsEditor
272-
isInitial={isInitialAL}
273259
updatedSourceCode={(code: string) => updateSourceCode(code)}
274-
setIsInitial={(val) => setIsInitialAL(val)}
275260
setCheckUnsavedChanges={(val) => setCheckUnsavedChanges(val)}
276261
/>
277262

0 commit comments

Comments
 (0)