Kurt 611 (#612)
* disable python exectution * update prod url
This commit was merged in pull request #612.
This commit is contained in:
@@ -41,8 +41,8 @@ RUN npm install aws-lambda-ric@1.0.0
|
||||
RUN conda --version
|
||||
|
||||
# Install CadQuery
|
||||
RUN conda install -c cadquery -c conda-forge cadquery=master ocp=7.5.2 python=3.8
|
||||
RUN conda info
|
||||
# RUN conda install -c cadquery -c conda-forge cadquery=master ocp=7.5.2 python=3.8
|
||||
# RUN conda info
|
||||
|
||||
# Get a copy of cq-cli from GitHub
|
||||
RUN git clone https://github.com/CadQuery/cq-cli.git
|
||||
|
||||
@@ -9,7 +9,7 @@ const stl = async (req, _context, callback) => {
|
||||
console.log('eventBody', eventBody)
|
||||
|
||||
const { file, settings } = JSON.parse(eventBody)
|
||||
const { error, consoleMessage, fullPath, tempFile } = await runCQ({
|
||||
const { error, fullPath } = await runCQ({
|
||||
file,
|
||||
settings,
|
||||
})
|
||||
@@ -17,8 +17,8 @@ const stl = async (req, _context, callback) => {
|
||||
error,
|
||||
callback,
|
||||
fullPath,
|
||||
consoleMessage,
|
||||
tempFile,
|
||||
consoleMessage: '',
|
||||
tempFile : '',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -30,31 +30,32 @@ export const runCQ = async ({
|
||||
].join(' ')
|
||||
console.log('command', command)
|
||||
let consoleMessage = ''
|
||||
try {
|
||||
consoleMessage = await runCommand(command, 30000)
|
||||
const params = JSON.parse(
|
||||
await readFile(customizerPath, { encoding: 'ascii' })
|
||||
)
|
||||
await writeFiles(
|
||||
[
|
||||
{
|
||||
file: JSON.stringify({
|
||||
customizerParams: params,
|
||||
consoleMessage,
|
||||
type: 'stl',
|
||||
}),
|
||||
fileName: 'metadata.json',
|
||||
},
|
||||
],
|
||||
tempFile
|
||||
)
|
||||
await runCommand(
|
||||
`cat ${stlPath} /var/task/cadhub-concat-split /tmp/${tempFile}/metadata.json | gzip > ${fullPath}`,
|
||||
15000,
|
||||
true
|
||||
)
|
||||
return { consoleMessage, fullPath, tempFile }
|
||||
} catch (error) {
|
||||
return { error: consoleMessage || error, fullPath }
|
||||
}
|
||||
return { error: 'python execution currently disabled, see: https://github.com/Irev-Dev/cadhub/issues/611', fullPath }
|
||||
// try {
|
||||
// consoleMessage = await runCommand(command, 30000)
|
||||
// const params = JSON.parse(
|
||||
// await readFile(customizerPath, { encoding: 'ascii' })
|
||||
// )
|
||||
// await writeFiles(
|
||||
// [
|
||||
// {
|
||||
// file: JSON.stringify({
|
||||
// customizerParams: params,
|
||||
// consoleMessage,
|
||||
// type: 'stl',
|
||||
// }),
|
||||
// fileName: 'metadata.json',
|
||||
// },
|
||||
// ],
|
||||
// tempFile
|
||||
// )
|
||||
// await runCommand(
|
||||
// `cat ${stlPath} /var/task/cadhub-concat-split /tmp/${tempFile}/metadata.json | gzip > ${fullPath}`,
|
||||
// 15000,
|
||||
// true
|
||||
// )
|
||||
// return { consoleMessage, fullPath, tempFile }
|
||||
// } catch (error) {
|
||||
// return { error: consoleMessage || error, fullPath }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Camera } from 'src/helpers/hooks/useIdeState'
|
||||
|
||||
export const lambdaBaseURL =
|
||||
process.env.CAD_LAMBDA_BASE_URL ||
|
||||
'https://oxt2p7ddgj.execute-api.us-east-1.amazonaws.com/prod'
|
||||
'https://2inlbple1b.execute-api.us-east-1.amazonaws.com/prod2/'
|
||||
|
||||
export const stlToGeometry = (url) =>
|
||||
new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user